[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

Re: [LI] can't read /proc/meminfo



On Wed, 29 Sep 1999, Guruprasad, Mahendrakar  V (IE10) wrote:

> Hi,
> 	one strange thing I observed. you can't read /proc/meminfo through
> program ( which uses open, read
> 	kind of stuff to read /proc/meminfo). you even can't determine the
> size of file/proc/meminfo through lseek(fd, 0,2)
> 	May be because the file is continuously changing.
> Bye

Hi,

Ofcourse the file is changing continuously.
But You can do it.  Read everything in a single stretch and parse.
say 512 bytes at a time(that's more than enough for this file)
The program will succeed.

Now try reading 1 byte at a time, the program will certainly fail.

sudheer


- --------------------------------------------------------------------
For more information on Linux in India visit http://www.linux-india.org/
The Linux India mailing list does not accept postings in HTML format.

------------------------------