Boost logo

Boost :

From: Lars Gullik Bjønnes (larsbj_at_[hidden])
Date: 2005-01-25 16:28:45


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

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk