|laziness, impatience, and hubris|
How to Get Full Path Name on Win32 Systemby ack (Deacon)
|on Mar 11, 2008 at 21:18 UTC||Need Help??|
ack has asked for the
wisdom of the Perl Monks concerning the following question:
I was just reading Beginners guide to File::Find in the Monastary Tutorials (and the pod documentation for File::Find) and was testing some of the examples.
The code is simple and is as follows:
The output is:
According to the Tutorial and the comments, this should work on a Win32 system (which is what I was testing this on). But rather than giving me the 'full path', it gives me '.'.
I seem to recall that on Win32 systems there can be problems with getting full path names; but the Tutorial says otherwise.
How does one get the 'full path' name rather than the '.'? Or just point me in the right direction to address this issue since I can't remember where I saw/read the caveats about path names re: Win32 system?
UPDATE: Thanks everyone. I went with the full directory approach in the find() and it works just fine. In scouting around CPAN I also found File::Find::Wanted which is a real nice, simple wrapper around File::Find and is a bit more intuitive than File::Find. Though it's not clear how one gets to the variables $File::Find::name, $File::Find::dir...which are really nifty in the File::Find module.
ack Albuquerque, NM