Fixing broken links
Paul Smith
paul at mad-scientist.net
Wed Feb 17 19:57:32 UTC 2016
On Wed, 2016-02-17 at 11:34 -0800, rikona wrote:
> I'd consider other ways to do this if anyone has suggestions...
I don't know anything about konq so I doubt it can do this but...
Part of the answer to your problem, perhaps, is to use _relative_
pathnames in your symlinks, not _absolute_ links.
E.g., if your link is:
foo -> ../otherdir/bar
and not:
foo -> /home/rikona/docs/otherdir/bar
then as long as you don't rearrange things so that the relative path is
broken, you're fine. For example you can move /home/rikona/docs to
/home/shared/public/other/docs and everything will still work.
Of course if you rename "otherdir" to "anotherdir" things will still be
broken.
However, using symlinks as a general-purpose tagging facility is very
prone to breakage if you are going to rearrange things. There's simply
no way to find all the things "pointing to a file" except by examining
every symlink on the system and checking to see if it points to that
file. And you'd have to do that for every file you wanted to move.
My recommendation is to look around for some sort of application which
will allow you to tag files and store that metadata separately from the
filesystem (e.g., storing the tags in a separate database, not using
symlinks). It might let you search for files based on tags, etc.
More information about the ubuntu-users
mailing list