Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2005-01-29 21:29:40


"Lars Gullik Bjønnes" wrote:
> The argument is not "shells do it that way". But "cp" does it that
> way. "cp" is not a shell it is a program specialized for copying
> files. Also that by not allowing overwrite of existing files it opens
> up for a race.

Not only a race. Delete/recreate loses all metainformation attached to the
original file - inode, attributes, permissions, ACLs, alternate
forks/streams; it is also possible that the program doesn't have permission
to delete+recreate, but does have permission to overwrite this specific
file.

Of course one can use fopen and friends instead. ;-)


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