Boost logo

Boost :

From: Lars Gullik Bjønnes (larsbj_at_[hidden])
Date: 2005-01-29 21:03:18


Beman Dawes <bdawes_at_[hidden]> writes:

| At 09:55 AM 1/28/2005, Lars Gullik Bjønnes wrote:
| >Jonathan Wakely <cow_at_[hidden]> writes:
| >...
| >| ssize_t sz;
| >| while ( (sz = ::read( infile, buf.get(), buf_sz )) > 0
| >| && (sz = ::write( outfile, buf.get(), sz )) > 0 ) {}
| >
| >exactly the kindo thing that has been solved of the implementators for
| >the
| > out << in.rdbuf();
| >case.
>
| It is really up to the implementor.

Exactly and by exploiting the implementors knowledge you don't need
comments like "// TODO: Ask POSIX experts if this is the best way to copy a file"

| I'm happy with the current code,
| modulo any needed bug fixes. It seems too heavy-weight to use
| iostreams for such a simple problem.

If you look at a strace you will see that iostreams is not really
heavy-weight for such a simple problem... and if it is it is a lousy
iostreams implementation.

But as long as I am allowed to overwrite the target and have it use
O_TRUNC then I am happy.

-- 
	Lgb

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk