|
|
Log in / Subscribe / Register

The trouble with symbolic links

The trouble with symbolic links

Posted Jul 8, 2022 2:32 UTC (Fri) by k8to (guest, #15413)
In reply to: The trouble with symbolic links by Sesse
Parent article: The trouble with symbolic links

Very much this.

99% of the time, you can just ignore them entirely as a developer and everything works.

It's true that once developers start trying to care about symbolic links explicitly they often make many errors. Usually it's enough to just use libc's realpath and consider the final answer. Trying to care about symbolic links in more detail is usually a path to madness.

For some problems, there are reasonable patterns, like writing code to "monitor" a directory and its contents, you usually don't want to follow links at all to avoid infinite loops etc, with limited user-provided exceptions.

For other problems, there may not be a good solution. I haven't worked on any problems like that in my long programming career, however.


to post comments


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds