filesystem::copy_file throws -- but why?
11 Dec
2003
11 Dec
'03
6:11 a.m.
I'm trying to use copy_file to, well, copy a file to a backup file (signified by adding ".bak" to the file's name). Here's what I'm doing, chopped way down: int processFile(const fs::path& fileName) { fs::path copyFileName(fileName.native_file_string() + ".bak"); fs::copy_file(fileName, copyFileName); } This throws an exception: boost::filesystem::path: invalid name "D:\Temp\CDFix\INDEX.HTM.bak" in path: "D:\Temp\CDFix \INDEX.HTM.bak" I don't see what's invalid about this name. From what I can tell, I'm fulfilling copy_file's preconditions and not falling into one of the cases where it's supposed to throw. What am I doing wrong? Thanks, Scott
7657
Age (days ago)
7657
Last active (days ago)
0 comments
1 participants
participants (1)
-
Scott Meyers