This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fix for : read()


Hi Corinna,

(For continued reference:)
The Tape Block Length information is in MSDN, within the document Q161338 in the
knowledge base.

The CygWin read() function calls ReadFile() repeatedly while the programmers read buffer-length parameter value "#of bytes" hasn't been read from the handle. Under Unix, low-level IO read() doesn't always return 100 bytes in this call:


rc = read (h, buf, 100);

In fact, if h refers to a tape, which also has a vaiable-block of data ready to be read at the current tape position.. You may only get, say, 80 bytes returned if it's a 80 byte block record. In CygWin, since it continues to call ReadFile() in the cygwin1.dll read() function, the programmer, me actually, loses all record of the tapes original data-block-length - with CygWin read() you might think the block was 100 bytes long - having started to read the next block on the tape. (20 bytes of it in this example.)

Jason.

_________________________________________________________________
SEEK: Now with over 50,000 dream jobs! Click here http://ninemsn.seek.com.au/



-- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]