Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com X-Originating-IP: [210.84.179.8] X-Originating-Email: [jasonwinter AT hotmail DOT com] X-Sender: jasonwinter AT hotmail DOT com From: "Jason Winter" To: cygwin AT cygwin DOT com Subject: Fix for : read() Date: Tue, 02 Mar 2004 01:38:16 +0000 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 02 Mar 2004 01:38:16.0824 (UTC) FILETIME=[08ECAF80:01C3FFF7] 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/