
Beman Dawes <bdawes@acm.org> writes: | At 09:55 AM 1/28/2005, Lars Gullik Bjønnes wrote: | >Jonathan Wakely <cow@compsoc.man.ac.uk> 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