Boost logo

Boost :

From: Alisdair Meredith (alisdair.meredith_at_[hidden])
Date: 2002-03-19 06:04:08

However, it surely performs well as a lowest-common-denominator approach for a cross-platform library.

Hopefully we can support more optimised solutions for specific platforms, but something similar should be widely supportable as a fall-back implementation. Here, it's very simplicity is in its favour!


>>> gila_at_[hidden] 19 March 2002 06:24:36 >>>
In my tests, I've found a combination of stat, mmap (there's a similar
win32 api), and memcpy to be the fastest implementation available. I
don't have any benchmarks available but it also stands to reason that
handing the file copy routine over to the kernal will yield the best
possible results for a general purpose file copy.

Given that your astoundingly simple implementation is so, well,
simple, it hardly seems to warrent inclusion as a file copy routine
and should just be one of the many tricks in your bag.

On Tue, Mar 19, 2002 at 04:37:33PM +1100, Dylan Nicholson wrote:
> If we definitely decide to put in a "copy_file" routine into boost::filesystem,
> then believe it or not, the following single line of code is remarkably
> efficient (at least under HP aCC 3.33, which is what I tested it with):
> bool copy(const char* src, const char* dest)
> {
> return std::ofstream(dest) << std::ifstream(src).rdbuf();
> }
Unsubscribe & other changes:


For further information on Renault F1 visit our web site at This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please destroy and notify Renault F1 on +44 1608678000."


Boost list run by bdawes at, gregod at, cpdaniel at, john at