![]() ![]() In the first case, /tmp/a is the parent directory of /tmp/a/b. In the second case, /tmp/a/b/l is the parent directory of /tmp/a/b/l/b, which is the same as /tmp/a/b. They multiply filesįiles are identified by paths, after resolving symlinks. ![]() There are infinitely many further paths of the file. They are the same in terms of their inode number of course. But if you do not explicitly expect loops, there is no reason to check for that.Ī directory hardlink can also point to a child directory, or a directory that is neither child nor parent of any depth. $ diff -s /Some/Direcoty/foobar.txt /home/nischay/Hard-Directory/foobar.txt $ echo foo > /home/nischay/Hard-Directory/foobar.txt Your example $ ln /Some/Direcoty /home/nischay/Hard-Directory In this case, a file that is a child of the link would be replicated to two files, identified by two paths. How can soft links to directories work then?Ī path that may contain softlinks and even soft linked directory loops is often used just to identify and open a file. In this case, symbolic links in the path can be resolved first, converting it to a minimal, and commonly agreed upon representation creating a canonical path: It can be used as a normal, linear path.īut there are other situations, when paths are used to compare files. ![]() This is possible, because the soft links can all be expanded to paths without the link. The command readlink can resolve a path to its canonical path: $ readlink -f /some/symlinked/path After doing that with all soft links in a path, the remaining path is part of a tree, where a path is always unambiguous.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |