-
Notifications
You must be signed in to change notification settings - Fork 92
Fix issue 60: confusing error messages in rename/createLink/createSymbolicLink #122
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also rebase on master, so we run this through the most recent CI incarnation.
POSIX's ENOENT error doesn't specify if the problem was with source or destination path. Throw error mentioning both paths instead of only first one. Fixes haskell#60
3d7f8a9
to
6e02c14
Compare
Previous issues have been address and the branch has been rebased against |
Per the comments on PR haskell#65, it should be unambiguous.
6e02c14
to
652608e
Compare
I'm so sorry, I really thought I had addressed that. Fixed now (and I will add a test) |
Very basic, but tests that the created link is a hard link and points to the original file
Added a test, which would have caught the previously mistake of creating symlinks when normal links were desired |
Suggested in haskell#122 discussion
304a59a
to
d92e482
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I just noticed that similar changes also need to happen in System/Posix/Files/ByteString.hsc
. Please make these consistent. There the filenames will be ByteStrings (RawFilePath
), and throw errors via System.Posix.ByteString.FilePath
.
The new function for two paths should probably be added to that module and its non-bytestring twin. |
ddbf63b
to
1dd03a7
Compare
Just in case we ever move a String type that is not a [Char], but something more like UTF-8 text. The more polymorphic <> should work even if String is no longer a list. Also, add a signature to throwErrnoTwoPathsIfMinus1_ Co-authored-by: Viktor Dukhovni <[email protected]>
1dd03a7
to
3dae5ac
Compare
Updated the code to use The |
Same as done for FilePath versions in 484566b
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice. Thanks.
Suggested in #122 discussion
Suggested in haskell#122 discussion
This fixes #60. It builds on #65 (I cherry-picked the commit), while addressing the issues raised there.