Skip to content

ln's error message is less useful than GNU ln's when trying to create a hardlink to a directory #9333

Description

@ais523

Most filesystems don't allow creating hardlinks to a directory. However, soon after installing uutils (as part of an OS upgrade), I tried to create a symbolic link to a directory and forgot the -s.

uutils ln gave me the following error message:

ln: failed to create hard link 'target' => 'link': Permission denied

which left me unsure of what was going on, and I didn't immediately realise what I did wrong.

Meanwhile, in the same situation, GNU ln gave this more useful message:

/usr/bin/gnuln: target: hard link not allowed for directory

which immediately let me realise that I was trying to create the wrong sort of link.

This isn't technically an incompatibility, in that both ln implementations error on the same impossible request: but the more descriptive error message would be more useful for users who made the same mistake that I did.

ln version:

ln (uutils coreutils) 0.2.2

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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