InspectsectorBuffer

Hello Guys
am new to QNX, I want to know how to program to Inspect sector Buffer available.

Kindly let me know the procedure and headers to include and procedures to follow

Regards
Mural

Maybe you can explain a little better what you mean by this. Do you want to be able to read sectors from the disk directly? Does this have to do with reading the I/O buffer that fopen sets up, and getc() reads from? Are you interested in how many bytes are available without going to the disk. This last question can be very complex. While you have a local buffer, the file system has the capability to pre-read files when it sees a pattern of sequential I/O. At least the QNX4 file system did, which I believe was carried on. If this isn’t complex enough, any specific drive may invisibly do the same type of stuff, reading tracks at a time instead of sectors.

Hello,

Yes
I want to read sectors from the disk directly,
I have to work with reading the I/O buffer that fopen sets up, and getc() etc.
One source will be connected to my system through either RS232 (an external drive or system )or USB drive, now I have to check how many bytes are available without going or going to the disk.

You can read sectors directly by opening /dev/hd0 .

I’m not sure what you meant by “reading the I/O buffer that fopen sets up”. I don’t think it’s possible without some hacking. Why exactly do you need to do that.

Mario, when you read a file by opening with fopen, and using fread, and getc, you are reading buffered input. More than what you request in a read operation may be transfered to the process and put in a buffer. Since the buffer is in your processes data segement, you can go and pre-view it if you want to. If you read with open and read, the OS will buffer data also, but it will not be visible to your process without doing an I/O call.