in reply to How to Get Full Path Name on Win32 System
Anyway: use rel2abs as a class method from File::Spec, or as a function from File::Spec::Functions. Try: either of these:
oruse File::Find; use File::Spec::Functions qw(rel2abs); $\ = "\n"; find \&print_name, "."; sub print_name{ print rel2abs($_) unless $_ eq "." or $_ eq ".."; }
use File::Find; use File::Spec::Functions qw(rel2abs); $\ = "\n"; find \&print_name, rel2abs("."); # or, just for ".": # use Cwd; # find \&print_name, cwd; sub print_name{ print $File::Find::name unless $_ eq "." or $_ eq ".."; }
There's a chance the formatting of the full path is still is not exactly the same as you expect from Windows: there could be a mixture of slashes or backslashes, or the case may not the same as the case for the real physical file/directory names. To fix both these issues, you can use GetLongPathName from Win32, which is a standard library on ActivePerl/Windows.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to Get Full Path Name on Win32 System
by ack (Deacon) on Mar 12, 2008 at 05:02 UTC | |
by bart (Canon) on Mar 12, 2008 at 11:55 UTC | |
|
Re^2: How to Get Full Path Name on Win32 System
by krishnoid (Novice) on Aug 28, 2009 at 18:22 UTC |