Skip to content

ln -t: a renamed target directory redirects the remaining links #15523

Open

Description

@abendrothj

With a target directory (-t, or several sources), uutils ln checks once that the target is a directory and then creates each link, and renames each backup, by joining the directory's path. If that path is renamed or replaced while ln runs, the remaining links go wherever it leads now. GNU ln keeps them in the directory it started with.

An -i prompt makes the gap easy to hit:

$ mkdir dir other; touch a b c dir/a dir/b other/b
$ ln -s -i -t dir a b c
ln: replace 'dir/a'?

While it waits, run mv dir moved; ln -s other dir in another shell, then answer y to both prompts.

GNU coreutils 9.12 creates all three links in moved, and other/b is untouched.

uutils main creates them in other, replacing other/b.

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