id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 4930,filesystem::copy_file() has inconsistent behavior when copy_option::overwrite_if_exists is used,postoronnimv77@…,Beman Dawes,"The behavior of filesystem::copy_file() function with copy_option::overwrite_if_exists option set is misleading and differs on Windows and on the rest (POSIX) systems. On Windows CopyFile() API is used for this which correctly overwrites the target file if it exists. On non-Windows systems open(2) is used with O_CREAT|O_WRONLY which causes only the first size(from_file) bytes of the destination file tp be overwritten with the source leaving the rest tail intact. So if the source file initially contains 'ABCD' and the destination contains 'abcde' the result of copy_file() with 'overwrite_if_exists option' set results the destination to contain 'ABCDe'. The fix seems trivial: add O_TRUNC option when opening the destination file.",Bugs,closed,To Be Determined,filesystem,Boost 1.44.0,Problem,fixed,,