Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^3: Collapsing paths

by ikegami (Patriarch)
on Dec 05, 2007 at 16:57 UTC ( [id://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.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2024-04-25 05:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found