Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!wuarchive!zaphod.mps.ohio-state.edu!uwm.edu!rutgers!cmcl2!adm!news From: S89405079%HSEPM1.HSE.NL@vm1.nodak.edu Newsgroups: comp.lang.pascal Subject: Blockread/write problem Message-ID: <24316@adm.BRL.MIL> Date: 29 Aug 90 12:09:24 GMT Sender: news@adm.BRL.MIL Lines: 49 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