Beefy Boxes and Bandwidth Generously Provided by pair Networks DiBona
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^3: Collapsing paths

by ikegami (Pope)
on Dec 05, 2007 at 16:57 UTC ( #655132=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Collapsing paths
in thread Collapsing paths

Depends on your system.

use File::Spec; print File::Spec->canonpath("foo/../bar/../baz/")."\n";
\baz

On system without symlinks, canonpath collapses x/../y (although not always correctly, as shown above).

Update: Technically, NTFS does have symlinks, but most software act as if they don't exist, including File::Spec.


Comment on Re^3: Collapsing paths
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://655132]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2013-05-20 01:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best material for plates (tableware) is:









    Results (401 votes), past polls