View Single Post
Old 11-26-2013, 02:10 AM   #13
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,466
Karma: 27757440
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
It's not the filesystem that pretends it's a file, it's most of the userland programs in linux, like cp, mv, find and so on. Every application (that does anything beyond simple reading and writing of files) written to work on linux has to be specifically aware of symlinks and deal with them.

For example, something as simple as renaming a file, if the file is a symlink, what should happen? Should the symlink be renamed or the file it points to? If the symlink contains a relative path, should it be updated?

Or consider enumerating all files in a directory tree, using symlinks to directories, you can easily create an infinite loop, so every bit of code that does this has to special case the possibility of infinite loops.

Then, there is no efficient way to get a list of all symlinks to a file, so it is not possible to rename files and preserve symlinks to them.

Symlinks can undoubtedly be handy, but they are a horrible hack, designed to try to workaround the limitations of the filesystem as datastore. It's a pity that we are stuck with the filesystem -- a datastore that was designed when computers were limited to a few kilobytes of RAM.
kovidgoyal is offline   Reply With Quote