
25 Jan
2005
25 Jan
'05
9:28 p.m.
What is the rationale for having copy_file fail if the target file exists? This is not how any cp/copy in any shell I know of works, actually quite surprising. And with boost.filesystem there is no way to avoid this, short of rewriting the function to allow it. The other way around would have been easy: fs::exists(target) || fs::copy_file(source, target) (One option is to delete the target before doing the copy, but then it is impossible to keep the same inode as before, and f.x. for backup files this is something that you want.) -- Lgb