I was told some days before that the file does not change continuously
while
you 've got it opened.
So i think (but did not try) that between the open() and close() the file
will
not appear to change. (and it does make sense anyway since reading
several bytes
is not an atomic operation).
>
>
>
> 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
i don't think so.
>
> 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.
again, i don't think so...
>
> sudheer
>
pascal
--------------------------------------------------------------------
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.