Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!wuarchive!zaphod.mps.ohio-state.edu!usc!orion.oac.uci.edu!ucivax!milne From: milne@ics.uci.edu (Alastair Milne) Newsgroups: comp.lang.pascal Subject: Re: (R)Blockread/write problem Message-ID: <26E201B9.5523@ics.uci.edu> Date: 3 Sep 90 07:09:44 GMT References: <24352@adm.BRL.MIL> Organization: UC Irvine Department of ICS Lines: 23 In <24352@adm.BRL.MIL> CDCKAB%EMUVM1.BITNET@cunyvm.cuny.edu ( Karl Brendel) writes: >Because the original code provided a variable for the optional "result" >parameter, BlockRead would not cause an I/O error (or a non-zero >IOResult) when reading the last partial block. It _would_, indeed, read >that partial block into the buffer. Unfortunately, there would be no >explicit indication that a partial block had been read. I'll double-check the documentation, but I don't believe that the result parameter and IOResult are mutually exclusive. If your read request wants more than is left in the file, you will still get a non-0 IOResult, whatever the NumberRead parameter reports. I agree that it would read the partial block (I also think the whole block should be zeroed first so that the unread part does not remain garbage) but that would set the IOResult so what *would* get suppressed is the following BlockWrite. This is from memory as I'm not where I can check this just now, but I believe I have it correct. Alastair Milne