Join GitHub today
copyFile does not copy metadata #40
In https://ghc.haskell.org/trac/ghc/ticket/5251, GHC trac user Orphi reports:
(GHC 7.0.2, directory 220.127.116.11 - not that I expect it to matter.)
The cause is simple: Rather than calling an OS-specific "please copy this file" function, the directory package attempts to implement this logic itself. And does it completely wrong.
The fix should be easy; we just need somebody to figure out what the appropriate native OS function is on each platform.
Comment by Orphi:
For reference, here are the Windows-specific things which are not copied by
Interestingly, the "read only" attribute is copied correctly.
I was unable to test the following, but I believe they will be lost too:
As you can see, Windows stores a hell of a lot of metadata about files, almost all of which the naive copyFile implementation is blindly stripping off. It wouldn't surprise me if it drops metadata on Unix too, although I haven't had time to test yet.
There is no such equivalent on Unix-like systems. The
I'm not sure it's good idea to change what
Except for Windows where