Perl: the Markov chain saw | |
PerlMonks |
Dereference a filesystem path with softlinksby narse (Pilgrim) |
on Apr 20, 2004 at 18:40 UTC ( [id://346747]=perlquestion: print w/replies, xml ) | Need Help?? |
narse has asked for the wisdom of the Perl Monks concerning the following question:
This problem is hard for me to explain so let pose this example: I have a directory /foo/ and a link to it names /bar/ . If I run a script from within bar that calls Cwd::cwd(), I get the path /foo/ instead of bar which is fine. The only problem then is I want to compare the cwd with other path variables that point to the soft link. String comparison on /foo/ and /bar/ is false, when in actuality they are the same directory. In my specific code, I would like to use File::Spec::rel2abs() to complete path names from a relative point so the ideal would be to get /foo/ from /bar/, not simply getting the indirect pwd. Is there a module that will do this? Thanks in advance.
Back to
Seekers of Perl Wisdom
|
|