Normally to change a symlink target one will first unlink the file and then re-creating the symlink with the new target path. However it will be assigned a new inode number.
Maybe there is a private Mac api with an update_target_for_symlink()
function, so the inode can stay the same?
In case you wonder what I need it for.. a file manager. I doubt that this is possible at all. Anyways thats what makes it interesting.
If a symbolic link is deleted, its target remains unaffected. If a symbolic link points to a target, and sometime later that target is moved, renamed or deleted, the symbolic link is not automatically updated or deleted, but continues to exist and still points to the old target, now a non-existing location or file.
In order to follow symbolic links, you must specify ls -L or provide a trailing slash. For example, ls -L /etc and ls /etc/ both display the files in the directory that the /etc symbolic link points to. Other shell commands that have differences due to symbolic links are du, find, pax, rm and tar.
It looks a lot like this isn't possible at all.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With