in reply to How does one compare the relationship between two file system paths in a portable way?
If the only systems running Perl were Unix, Dos, or Mac this would be easy: all I would need to do is canonize the two paths and then compare them as strings.Considering that Unix allows symbolic links, and mounts anywhere on the current filesystem (not to mention the fact that things can be mounted more than once), this is not as easy as you may think.
For example, if A is a substring of B, then A is the parent of B.Yes, but the reverse isn't true. If A isn't a substring of B, then that doesn't mean A isn't the parent of B.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How does compare the relationship between two file system paths in a portable way?
by ELISHEVA (Prior) on Aug 17, 2009 at 23:14 UTC | |
by JavaFan (Canon) on Aug 17, 2009 at 23:43 UTC | |
by quester (Vicar) on Aug 18, 2009 at 04:29 UTC | |
by JavaFan (Canon) on Aug 18, 2009 at 09:25 UTC |