-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
copyFile does not copy metadata #40
Comments
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. |
Windows has There is no such equivalent on Unix-like systems. The I'm not sure it's good idea to change what TODO:
Except for Windows where |
In https://ghc.haskell.org/trac/ghc/ticket/5251, GHC trac user Orphi reports:
The
copyFile
function fails to copy various metadata to do with a file.(GHC 7.0.2, directory 1.1.0.0 - 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.
The text was updated successfully, but these errors were encountered: