From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,9bdd666589befb0f X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!inka.de!rz.uni-karlsruhe.de!news.belwue.de!newsfeed.ision.net!newsfeed2.easynews.net!ision!newsfeed.arcor.de!news.arcor.de!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Palatable Windows IO using Ada Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.14.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <1144369304.698267.277640@u72g2000cwu.googlegroups.com> <15qxrbngb2kll.wkigwit0g1tn.dlg@40tude.net> <1144427423.152451.170970@j33g2000cwa.googlegroups.com> <1144437671.065921.226960@e56g2000cwe.googlegroups.com> Date: Fri, 7 Apr 2006 22:49:04 +0200 Message-ID: NNTP-Posting-Date: 07 Apr 2006 22:49:02 MEST NNTP-Posting-Host: f7f678c3.newsread4.arcor-online.net X-Trace: DXC=?H?JEM[mVlTadj;CH1=J1P:ejgIfPPldTjW\KbG]kaMX]kI_X=5KeaV5g6MQI1NOn\[6LHn;2LCV^[ On 7 Apr 2006 12:21:11 -0700, Le wrote: >>You cannot read any device not knowing the size of input. > > You referred to blocks & lines previously indicating that you > understood what was being referred to. No, I didn't. Blocks were mentioned having block-oriented devices in mind. Lines were for record-oriented I/O existed, for example, in RSX-11. > I was speaking of byte sequences which vary in *length*. which length is determined by what? > ... ReadFile blocks or times out. This is plain wrong. Here is the citation from MSDN "Synchronization and Overlapped Input and Output" "The WriteFile, ReadFile, DeviceIoControl, WaitCommEvent, ConnectNamedPipe, and TransactNamedPipe functions can be performed either synchronously or asynchronously." and further: "... Functions called for overlapped operation can return immediately, even though the operation has not been completed. This enables a time-consuming I/O operation to be executed in the background while the calling thread is free to perform other tasks. For example, a single thread can perform simultaneous I/O operations on different handles, or even simultaneous read and write operations on the same handle." >From MSDN "ReadFile" "... If hFile is opened with FILE_FLAG_OVERLAPPED and lpOverlapped is not NULL, the read operation starts at the offset that is specified in the OVERLAPPED structure, and ReadFile may return before the read operation is complete. In this scenario, ReadFile returns FALSE and the GetLastError function returns ERROR_IO_PENDING, which allows the calling process to continue while the read operation completes." -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de