From: Brey, Edward D (EdwardDBrey_at_[hidden])
Date: 2002-03-19 10:12:29
All this talk of efficiency of byte-orientated file copying mechanisms in
platform-specific realms (e.g. memory mapped I/O) seems out of place to me.
Why would one not map onto the high level operating system calls to copy a
file, e.g. CopyFile in Win32? Besides being presumably the most efficient,
it is often the only correct choice. The Win32 documentation spells out
copying a file by creating a new file and manually moving over the contents
as bad practice, because doing so can defeat higher-level operating system
functionality such as encryption.
For the fallback, portable implementation, which is untweaked for any given
platform, of course, the stream buffer technique is very nice. But for
platform-tailored code, it generally makes sense to tie into the OS at the
highest level possible.
From: Fedder Skovgaard [mailto:fsk_at_[hidden]]
Sent: Tuesday, 19 March 2002 6:57 AM
Subject: Re: [boost] Remarkably efficient file copy
I think it's a viable route to take. Nicolai Josuttis writes: "This is
probably the fastest way to copy files by using C++ I/O streams."
See"The C++ standard Library" (ISBN 0201379260) Chapter 13.14.3.
You should, obviously be able to get better performance by using platform
specific calls and technologies (such as Asynchroneous IO and Memory mapped
files on Win32).
But the point lies (in my perspective) in the subphrase "by using C++ I/O
streams". Most operating systems also sports memory management routines
that out-perform new / delete for specific purposes, but that doesn't mean
that new / delete is a bad thing.
Just my two cents.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk