rinceWind has asked for the wisdom of the Perl Monks concerning the following question:
However, I'm looking at code that handles arbitrary paths that the caller has passed in. There is a distinct possibility that the path might contain updir segments (i.e. '..' in Unix). I want to reduce this to a canonical path. I tried File::Spec->canonpath, and was disappointed to find that it does not deal with '..', nore does rel2abs, nor does no_upwards - all of which suggest that they might do the job.
Have I missed something? Or is there another CPAN module which achieves this? I will write one if there isn't.
--
I'm Not Just Another Perl Hacker
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to get a true canonical path
by eserte (Deacon) on Jun 09, 2004 at 14:32 UTC | |
by hsinclai (Deacon) on Jun 09, 2004 at 14:56 UTC | |
by rinceWind (Monsignor) on Jun 09, 2004 at 16:30 UTC | |
by eserte (Deacon) on Jun 09, 2004 at 16:55 UTC | |
|
Re: How to get a true canonical path
by valdez (Monsignor) on Jun 09, 2004 at 16:01 UTC | |
|
Re: How to get a true canonical path
by mojotoad (Monsignor) on Jun 09, 2004 at 16:38 UTC | |
|
Re: How to get a true canonical path
by jepri (Parson) on Jun 09, 2004 at 14:28 UTC | |
|
Re: How to get a true canonical path
by pelagic (Priest) on Jun 09, 2004 at 21:14 UTC | |
by Anonymous Monk on Jun 21, 2019 at 09:03 UTC | |
by haukex (Archbishop) on Jun 21, 2019 at 10:46 UTC |