Yes, it depends on the OS. The source code shows that copy_file()(and other operations) generates the following errors:
if (ec == 0)
BOOST_FILESYSTEM_THROW(filesystem_error(message,
p, error_code(BOOST_ERRNO, system_category())));
else
ec->assign(BOOST_ERRNO, system_category());
system_category()indicates errors that occur from the operating system and BOOST_ERRNOon Posix systems errno.
In Posix, the main call open()with O_CREATand O_EXCLwill fail and set errnoto EEXISTwhen the file already exists.
source
share