🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #16428

Re: File Copy Operation

#16428
From: Remy Lebeau (TeamB)
Date: Thu, 15 May 2003 22:58
20 lines
1959 bytes
"Ed Mulroy [TeamB]" <ed@mulroyREMOVETHESECHARS.org> wrote in message
news:3ec3c37a@newsgroups.borland.com...

> I would probably use CreateFile, ReadFile,
> WriteFile and CloseHandle and specificly open
> with FILE_FLAG_NO_BUFFERING and
> allocate aligned data buffers to facilitate that mode.

If you're conserned about speed, then memory mapping the soource file will
be much faster then using ReadFile() for it.  By mapping the file into
memory (CreateFileMapping() and MapViewOfFile()), you can access the file
data directly as a simple BYTE* array, hardly any disk I/O is used at all
(except for maybe occasional page swapping if the file is very large).  Disk
I/O is always a bottleneck when performing data processing, so the more
processing you can do in memory directly, the better the performance will
be.


Gambit
Technical Details
Message-ID: <3ec41b29$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.icl.net!newsfeed.fjserv.net!news.maxwell.syr.edu!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail
References: <3ec35dd4@newsgroups.borland.com> <3ec3944e$1@newsgroups.borland.com> <3ec3be2e@newsgroups.borland.com> <3ec3c37a@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,2c3eb0c8d9515a68
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-05-15 16:02:57 PST
From: "Remy Lebeau \(TeamB\)" <gambit47@yahoo.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3ec35dd4@newsgroups.borland.com> <3ec3944e$1@newsgroups.borland.com> <3ec3be2e@newsgroups.borland.com> <3ec3c37a@newsgroups.borland.com>
Subject: Re: File Copy Operation
Date: Thu, 15 May 2003 15:58:52 -0700
Lines: 22
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 207.175.226.26
Message-ID: <3ec41b29$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1053039401 207.175.226.26 (15 May 2003 15:56:41 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.icl.net!newsfeed.fjserv.net!news.maxwell.syr.edu!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail