How can I check that a given regular file of path f is a descendant of a directory of path d. If not for symlinks, I would just check if d (with a trailing slash) is prefix to f.
Now with symlinks this gets marginally more complicated, as I could find the physical paths of the ancestors of f and compare each of them to the physical path of d. However, I believe there might be a userland utility for that, is there one?
| ||||
|
feedback
|
| |||||
feedback
|
|
My 'ls' command has flag "--dereference-command-line-symlink-to-dir" that shows the full path to the file. This 'ls' is from GNU coreutils 6.9. | |||||
feedback
|
