uutils / uutils/coreutils

ln: ln doesn't turn `/` in link target paths into `\` on Windows

Open
#6,439 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

P - Windows U - ln
Dominant language
Rust
Stars
24.1k
Forks
2k
Avg merge
1d 5h
Merged PRs (30d)
365

Description

While most functions in coreutils correctly translate / in paths into \ on Windows, ln doesn't quite:

> mkdir test\dir
> >test\file echo Hello
> coreutils ln -fs test/dir symlink-dir
> coreutils ln -fs test/file symlink-file
> dir
:: snip ::
 Directory of C:\foo

2024-05-30  10:03    <DIR>          .
2024-05-30  10:02    <DIR>          ..
2024-05-30  10:03    <SYMLINKD>     symlink-dir [test/dir]
2024-05-30  10:03    <SYMLINK>      symlink-file [test/file]
2024-05-30  10:03    <DIR>          test
:: snip ::

Note how the link target paths still contain /, and the links are unusable:

> type symlink-file
The system cannot find the file specified.
> dir symlink-dir
:: snip ::
 Directory of C:\foo\symlink-dir

File Not Found

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported commands on Windows, then locate the ln command implementation and its handling of link targets. Compare it with the other Windows path translations described in the issue; done means links created from targets such as test/dir and test/file resolve correctly and can be inspected with dir and type.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli, operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.