Cabal: outstanding copyFile bug?
Simon Marlow
simonmarhaskell at gmail.com
Wed Aug 23 06:05:23 EDT 2006
Frederik Eaton wrote:
>>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
I've copied the useful points from this discussion into a comment in
System.Directory, backed out the change I made yesterday, and filed a ticket for
doing what you suggest above.
Cheers,
Simon
More information about the Libraries
mailing list