id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 4438,Possible infinite loop in boost:: filesystem::copy_file for unix,Roberto Carlos Toledano Gómez ,Beman Dawes,"In the write cycle: do { if ((sz = ::write(outfile, buf.get() + sz_write, 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); Always try to write a number of bytes strictly greater than zero and the api ::write returns according to the official documentation :"" On success, the number of bytes written is returned (Zero Indicates Nothing Was Written). On error, -1 is returned, and errno is set appropriately"". Now imagine that the ::write api for any error or side effect, always returns zero, then we are in an infinite loop. To fix it I think the appropriate condition should be: if ((sz =:: write (outfile, buf.get () + sz_write, sz_read - sz_write)) <= 0) that is, change the Boolean operation for less than or equal to (<=) If I'm wrong please let me know what to learn. In my opinion you are the best.",Bugs,new,Boost 1.44.0,filesystem,Boost Development Trunk,Problem,,,