cmd/ln/bug

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
< cmd‎ | ln
Jump to navigation Jump to search

2023-09-21

There seems to be a bug in the reporting when a desired link-file already exists.

Real-life example:

root@statler ~/dev/git/futilities/human/apps (v0.6) $ ln -r --symbolic ./ftm ./ftm/go.php
ln: failed to create symbolic link './ftm/go.php': File exists

This is correct reporting: the parameters are in the wrong order, meaning that I've asked it to make a link to a nonexistent file with the name of the existing file.

root@statler ~/dev/git/futilities/human/apps (v0.6) $ ln -r --symbolic ./ftm/go.php ftm
ln: failed to create symbolic link 'ftm/go.php': File exists

This is misleading. The problem is not that 'ftm/go.php' exists (it's supposed to), but that the second one does.

Just to show a working solution, here's where I realized that the problem was that I was trying to create a link called "ftm" inside a folder which contained a folder also named "ftm". My solution was to back out another level. (Another solution might be to capitalize the folder-names.)

root@statler ~/dev/git/futilities/human/apps (v0.6) $ cd ..
root@statler ~/dev/git/futilities/human (v0.6) $ ln -r --symbolic apps/ftm/go.php ./ftm