From: Beman Dawes (bdawes_at_[hidden])
Date: 2006-01-25 21:26:22
"G. Wade Johnson" <gwade_at_[hidden]> wrote in message
>I was looking in the code for copy_file() and noticed what may be a bug. In
> the loop that handles partial writes, the code makes multiple attempts
> reducing the amount of data written each time. Unfortunately, the offset
> the data is not changed as well. See below.
> sz_write = 0;
> if ( (sz = ::write( outfile, buf.get(), sz_read - sz_write )) <
> 0 )
> sz_read = sz; // cause read loop termination
> break; // and error to be thrown after closes
> sz_write += sz;
> } while ( sz_write < sz_read );
> Unless I'm missing something, it looks like a partial write will result in
> first part of the buffer being written multiple times. I checked the
> in CVS and it appears to have the same code.
> Am I missing something or is this incorrect?
Thanks for the report. It will few more days before I can investigate.
Boost list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk