LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
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

Closed Thread
 
Search this Thread
Old 09-06-2006, 10:40 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, 12:14 PM   #2
apolinsky
Member
 
Registered: Oct 2004
Location: Brooklyn
Distribution: Slackware 13.1,12.1,12.2; Debian Sqeeze; Centos 5,6
Posts: 254

Rep: Reputation: 34
/proc is not a normal directory. Nothing is actually written on the disk. It is called a 'pseudo file system'. It records the state of the system as it boots up, with peripherals and associated drivers, default states of varius processes that run, available memory, and other critical system parameters.
 
Old 09-07-2006, 01:26 AM   #3
crabboy
Moderator
 
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,823

Rep: Reputation: 120Reputation: 120
duplicate post. Please continue discussion here:

http://www.linuxquestions.org/questi...d.php?t=480933
 
  


Closed Thread


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
STAT on directories of PROC ??? abhijit_awalekar Programming 1 09-06-2006 04:34 PM
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 ahz Programming 1 04-24-2005 08:24 AM


All times are GMT -5. The time now is 11:06 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration