I would like to copy a file to an other, and I would like to use Boost::copy_file. It has a paramether called copy_option which can be:
BOOST_SCOPED_ENUM_START(copy_option)
{none, fail_if_exists = none, overwrite_if_exists};
BOOST_SCOPED_ENUM_END
I have found another question regarding the overwrite_if_exists
behaviour here: how to perform boost::filesystem copy_file with overwrite
My problem however is that I don't know how to use the fail_if_exists = none
option. I would like to skip the copy operation, if the target file already exists.
I know its possible with if ( !exists(path) )
but I want to understand how does copy_option
work.
How can I use fail_if_exists = none
inside Boost::copy_file function?
Update: corrected the code, the one on boost doc website is kind of broken.