On Wed, Mar 15, 2000 at 05:24:17AM -0600, Sandeep Sundaram wrote:
> I wrote a small program in which I have used certain ioctls, which are used
> by the fdisk command, to get the partition details for an external disk. so
> far so good! it returns the table successfully. But when I remove the cable
> connecting the disk, i am still able to get the partition details, through
> the buffers(this is the Linux's implementation to make life easier!!)

> What i need to do is read from the disk directly! So, is there any way I
> can invalidate the buffer or bypass it and read from the disk directly.

There is no way to bypass the buffer, but there is a way to invalidate it.
With the 2.3.x series, I think you can specify a flag to open (O_something)
that'll open in raw mode bypassing the buffer.

> Or
> is there any other ioctl that will flush the buffer for me so that the next
> read will be done directly from the disk !!

Yes, there is one - hdparm uses it to calibrate disk read performance. Can't
remember it off the top of my head.

        -Arun

-----------------------------------------------------------------------
For more information on the LIH mailing list see:
http://lists.linux-india.org/lists/LIH

Reply via email to