Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!iuvax!ux1.cso.uiuc.edu!ux1.cso.uiuc.edu!uxh.cso.uiuc.edu!mead From: mead@uxh.cso.uiuc.edu Newsgroups: comp.lang.pascal Subject: Re: Blockread/write problem Message-ID: <13000013@uxh.cso.uiuc.edu> Date: 30 Aug 90 03:46:00 GMT References: <24316@adm.BRL.MIL> Lines: 53 Nf-ID: #R:adm.BRL.MIL:24316:uxh.cso.uiuc.edu:13000013:000:1530 Nf-From: uxh.cso.uiuc.edu!mead Aug 29 22:46:00 1990 /* Written 7:09 am Aug 29, 1990 by S89405079%HSEPM1@vm1.nodak.edu in uxh.cso.uiuc.edu:comp.lang.pascal */ /* ---------- "Blockread/write problem" ---------- */ Hi, I have a little problems with the use of blockread/blockwrite in TurboPascal. ======================================================================== The program: program xcopy; uses dos; const recsize=$FF; busize=120; var fil1,fil2:file; {The file to be copied} buffer:array[1..recsize,1..bufsize] of byte; {For blockread/write} recsread:integer; begin assign(fil1,'FILE.1');reset(fil1); {Sourcefile} assign(fil2,'TEMP');rewrite(fil2); {Targetfile} repeat blockread(fil1,buffer,bufsize,recsread); blockwrite(fil2,buffer,recsread); writeln(recsread:5,' blocks written.'); until recsread=0; close(fil1);close(fil2); end. ========================================================================= My problems: 1. When I run this program, I don't get the whole file copied (I miss several bytes). FILE.1 TEMP missing bytes: 7056 7040 16 6899 6784 115 6296 6272 24 3040 2944 96 Does anybody have the solution for this *irritating* problem <> 2. When I reset a read-only file, why does TurboPascal then say that it is impossible to open the file<> A lot of tanx to everybody with any solutions... Edwin Groothuis S89405079@hsepm1.hse.nl /* End of text from uxh.cso.uiuc.edu:comp.lang.pascal */