Cabal: outstanding copyFile bug?
frederik at a5.repetae.net
Tue Aug 22 20:55:31 EDT 2006
> I've fixed this in System.Directory.copyFile, although there doesn't
> seem to be a foolproof way to do it: if you unlink before opening,
> there's a chance that someone else can create the file in between.
> Still, this appears to be what install(3) does.
Since there seem to be compelling reasons to want both "unlink" and
"overwrite" behaviors available in the standard library, I suggest
keeping the current copyFile semantics and moving the new "unlink"
behavior to another function. The second function could be called
"installFile". Then, Cabal should be changed to use "installFile"
instead of "copyFile" (probably via a compatibility library).
Summary of behavior differences:
- effect on hard, soft links
- effect on ACLs, permissions, ownership, inode number
- effect on destinations without write permission
More information about the Libraries