Path: utzoo!mnetor!tmsoft!torsqnt!lethe!yunexus!ists!helios.physics.utoronto.ca!news-server.csri.toronto.edu!cs.utexas.edu!yale!cmcl2!adm!news From: CDCKAB%EMUVM1.BITNET@cunyvm.cuny.edu ( Karl Brendel) Newsgroups: comp.lang.pascal Subject: Re: TP BlockWrite problem? Message-ID: <26057@adm.brl.mil> Date: 19 Feb 91 17:05:27 GMT Sender: news@adm.brl.mil Lines: 44 In article <9102151241.aa01229@VGR.BRL.MIL>, NORM%IONAACAD.BITNET@tecmtyvm.mty.itesm.mx (Norman Walsh) wrote: >Has anyone ever had any difficulties with the builtin BlockWrite >function? Occasionally, Blockwrite fails. I have been tentative >about posting this question because I can't believe that the problem >is in Blockwrite. What has lead me to post it is that the problem >has now occured twice. In two different programs written by >different developers that do entirely different things. > >In both cases the block write indicates that 0 bytes where written >when there is no reason that I can think of for the write to fail. >There is certainly enough disk space, it's in a small loop, and the >file has been written to several times before (i.e. it isn't the >first time through the loop that fails). > >Leads: -It seems to happen on the last write to the file (the last > block). [...remainder deleted...] Perhaps you could post the code fragments that do the actual opening of and writing to the files in question. Note that if the files are opened with a "recsize" > 1, any BlockWrite which does not write an integral number of "records" will return a value of "result" which ignores the partial final "record". In such a case, an attempt to write 1 "record" would return a "result" of 0 no matter what the reason for failing to write the complete "record". When "result" returns as 0, what do IOResult and DOSError return? Is it possible that an io error is occuring at some other point in the program, with {$I-}, and IOResult is not being checked there? That causes a failure of at least some io until IOResult _is_ checked. +--------------------------------------------------------------------+ | Karl Brendel Centers for Disease Control | | Internet: CDCKAB@EMUVM1.BITNET Epidemiology Program Office | | Bitnet: CDCKAB@EMUVM1 Atlanta, GA, USA | | Home of Epi Info 5.0 | +--------------------------------------------------------------------+