Visit Jeremy's Blog.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


Closed Thread
  Search this Thread
Old 09-06-2006, 10:40 AM   #1
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
Registered: Oct 2004
Location: Brooklyn
Distribution: Slackware 14.1, 14.2; Debian Jessie; Debian Stretch
Posts: 314

Rep: Reputation: 38
/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
Senior Member
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,821

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

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 > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:15 PM.

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