in reply to rel2abs doesn't resolve relative paths?
The definition of "absolute" just means it starts with a slash. Some people refer to your intended result as a "canonical" path, and removing all backtracking as the "canonicalization" of a path. There are other elements to canonicalization, such as discovering aliased mount points or symlinks.
Perhaps something like this will work for you.
1 while ($path =~ s{ [^/]+ / \.\. / }{}x);
--
[ e d @ h a l l e y . c c ]
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: rel2abs doesn't resolve relative paths?
by tye (Sage) on Jun 05, 2003 at 15:36 UTC |