LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-06-2006, 10:39 AM   #1
abhijit_awalekar
LQ Newbie
 
Registered: Jan 2006
Posts: 5

Rep: Reputation: 0
Smile STAT on directories of PROC ???


Hello friends,
I am reading PROC directory through readdir().
I am successful in reading the directories in PROC
but i am not able to differentiate among them as
directory or file.
FUNCTION stat() runs good for . and ..
but for other it returns -1 since these are not
regular files.

Can anyone tell me how to differential them into
files or directories ?
 
Old 09-06-2006, 04:34 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
Try to use d_type field of struct dirent (from readdir). Does it work for you?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
hidden directories under proc... what are they for? : (/proc/.23142) syssyphus Linux - General 1 04-10-2006 04:23 PM
/proc/stat values don't add up ! mike0w Linux - General 0 10-25-2005 06:01 AM
New cpu values in /proc/stat? eldonz Linux - General 1 10-19-2005 01:16 PM
/proc/stat cpu info GDarkBladE Linux - Software 2 10-11-2005 04:16 PM
/proc/stat cpu ahz Programming 1 04-24-2005 08:24 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:09 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration