X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: "MikeC" Newsgroups: comp.os.msdos.djgpp References: <200709210020 DOT l8L0KG9G026658 AT envy DOT delorie DOT com> Subject: Re: How to copy a file? Lines: 35 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.3138 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138 Message-ID: Date: Fri, 21 Sep 2007 00:31:07 GMT NNTP-Posting-Host: 86.13.147.52 X-Complaints-To: http://netreport.virginmedia.com X-Trace: newsfe6-win.ntli.net 1190334667 86.13.147.52 (Fri, 21 Sep 2007 01:31:07 BST) NNTP-Posting-Date: Fri, 21 Sep 2007 01:31:07 BST Organization: ntl Cablemodem News Service To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Thanks DJ. Appreciated. Is my function losing a lot of time with the fopen/fread/fwrite/fclose? Would that account for almost twice the time for the copy, when using a 64K buffer? Another possibility, I suppose, is to delve into a DOS book and try it through a DOS interrupt. Why can't I do it with ... system(string); /* string contains "copy " */ ... as I tried? It compiles OK, and appears to execute when I single-step the program under RHIDE, but it takes an instant - not a minute or more - and the file doesn't get copied. I don't know what I'm doing wrong. Mike. "DJ Delorie" wrote in message news:200709210020 DOT l8L0KG9G026658 AT envy DOT delorie DOT com... > > I think you're doing it the right way, just keep in mind that DJGPP > programs have to move all that data back and forth between DOS memory > and DPMI memory. > > You might want to use open/read/write/close instead of > fopen/fread/fwrite/fclose though. > > Or, even faster, _read and _write, although then you have to deal with > all the odd DOS border cases. That does bypass the CRLF code, even > though you've disabled it there's still a check to see if it's enabled > for each read/write.