tl;dr a broken symbolic link.
Just a few moments ago, I was puzzled by this error message while trying to overwrite a symbolic link, in this case foobar, with a file:
cp: not writing through dangling symlink ‘foobar’
I really didn’t understand the word ‘dangling’ here, according to Google define, the word in language means:
hanging or swinging loosely.
Even after I understood what it meant, looking at the definition, I still don’t quite get it, but Wikipedia has a better explanation:
Symbolic links pointing to moved or non-existing targets are sometimes called broken, orphaned, dead, or dangling.
If the word were one of the first three adjectives, I’d immediately understand. ‘Dangling’ to me is not a word that sounds bad, does a swinging object sound like an absolutely bad thing to you?
Anyway, I removed the symbolic link and copied the file as I wanted, or you can use --remove-destination. Unfortunately, it takes lots of keystrokes if you don’t have auto-completion on cp, you might as well as rm first.
Note
-f or --force does not work in such case.
A quick grep on source of the GNU core utilities, ‘dangling’ can also be seen with chmod.
Dangling me, sounds about right.
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.