|
Making a symlink follow its target when the target moves
Suppose I have a symlink S pointing to a file F in a directory A, and I want to move F from A to another directory B. That move, by itself, will invalidate the symlink. What would be the best way to update S, other than explicitly rewriting it? If it would help, I could arrange for A to be a subdirectory of B or B to be a subdirectory of A. I'd prefer to do it within Dolphin, but I'll resort to the shell if necessary.
The old symlink S might be a full pathname rather than a path using ".." for navigation, which makes the problem harder. I want to do a bunch of these in a single action if possible. I expect it could be done using a shell procedure and iterating over the files to be moved, but that doesn't seem very simple.
The directory B has hundreds of entries, so I want to be sure not to lose track of F during the modification.
|