Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^3: Simple Path Cleanup

by ig (Vicar)
on May 10, 2009 at 10:34 UTC ( [id://763125]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Simple Path Cleanup
in thread Simple Path Cleanup

It is a long time since I last deluded myself that a hard link to a directory would be a good thing. Even then it was discouraged due to concerns with infinite loops in directory traversal. IMHO it is a good thing that it is more strongly prohibited in most systems these days.

I did come across a simple algorithm for resolving paths to a "canonical" path even if hard links to directories are allowed: follow all the links to the ultimate directory, then follow the chain of ".." back to the root directory. This assumes only that ".." in every directory is set to the "canonical" parent of that directory, despite any other links that might exist.

If you are a bit paranoid (or work with people like I was in years gone by, who like to do things like making hard links to directories and other twisted manipulations of the file system) you might also be concerned about multiple mounts of file systems and directories that are possible on some systems, particularly with some loopback file systems. Usually one would only have one read/write mount at a time, but I understand multiple read/write mounts are possible in some cases.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2024-04-19 15:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found