At 12:57 PM 12/11/2003, Scott Meyers wrote:
On Thu, 11 Dec 2003 08:32:06 +0100, Galante Michele wrote:
int processFile(const fs::path& fileName) { fs::path copyFileName(fileName.string() + ".bak"); fs::copy_file(fileName, copyFileName); }
I had tried this before. It also throws.
It would have to be:
int processFile(const fs::path& fileName)
{
fs::path copyFileName(fileName.string() + ".bak", fs::native);
fs::copy_file(fileName, copyFileName);
}
I'd probably write it like this, just for stylistic reasons:
int processFile(const fs::path& fileName)
{
fs::copy_file(fileName,
fs::path(fileName.string() + ".bak", fs::native));
}
Also, if you haven't already done something similar, change the name of
your main() function to cpp_main, after adding:
#include