Skip to content

Wrong order in error message for symlinks and hardlinks (again) #353

@nh2

Description

@nh2

PR #122 introduced swapped paths in error messages for createLink and createSymbolink link

The error message created by this change is wrong (and a regression vs my fix from https://github.com/haskell/unix/pull/84/files).

It was made incorrect by this "refactor" commit:

82fcb2b#diff-e0789aac9eee87c133e527286ccf09ab2931bf91b90115278ba7543961105991L233-L255

throwErrnoTwoPathsIfMinus1_ uses the terminology path1 to path2.

That is correct for rename where path1 is renamed by name2 -- order (source, target).

But it is incorrect for hardlinks and symlinks, where the order is swapped (target, linkpath).

So the message says mytarget to mylinkpath, which is the wrong way around.


To make sure this doesn't happen again, I think we should also rename the function arguments from createSymbolicLink name1 name2 to createSymbolicLink target linkname.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions