[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

How do I purge a kernel buffer used by a given file descriptor?



Hi,

Can somebody tell me how to ensure that a file read
goes to disk rather than a buffer?  I have studied the
low level and stream I/O documentation at
www.gnu.org/manual/glibc-2.2.5. I have also done some
experimenting with low level and stream I/O.

I want to write a chunk of data to a file and then
read it back to verify the integrity of the data on
disk.  Neither the fread(FILE) nor the read(int)
function makes the disk spin.  The data which was
written is still buffered and so they just grab it
from there.  The only function which looked promising
was __fpurge(FILE *).  I suspect this function only
purges user buffers, not kernel buffers, and so a
subsequent read would go to the kernel buffer, not
disk.

Suggestions?

Thanks!
  Damon

__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com



Reply to: