Difference between revisions of "cmd/ln/bug"
Jump to navigation
Jump to search
(Created page with "==2023-09-21== There seems to be a bug in the reporting when a desired link-file already exists. Real-life example: <syntaxhighlight lang=Bash> root@statler ~/dev/git/futilit...") |
|||
Line 3: | Line 3: | ||
Real-life example: | Real-life example: | ||
+ | <syntaxhighlight lang=Bash> | ||
+ | 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 | ||
+ | </syntaxhighlight> | ||
+ | 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. | ||
+ | |||
<syntaxhighlight lang=Bash> | <syntaxhighlight lang=Bash> | ||
root@statler ~/dev/git/futilities/human/apps (v0.6) $ ln -r --symbolic ./ftm/go.php ftm | 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 | ln: failed to create symbolic link 'ftm/go.php': File exists | ||
+ | </syntaxhighlight> | ||
+ | '''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.) | |
− | + | <syntaxhighlight lang=Bash> | |
− | |||
− | |||
− | |||
− | |||
root@statler ~/dev/git/futilities/human/apps (v0.6) $ cd .. | 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 | root@statler ~/dev/git/futilities/human (v0.6) $ ln -r --symbolic apps/ftm/go.php ./ftm | ||
</syntaxhighlight> | </syntaxhighlight> |
Latest revision as of 13:47, 21 September 2023
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