Win32's GetFullPathName and GetLongPathName will do that.
The former also converts the path to an absolute path.
The latter also expands short file names into long file names.
use Win32 qw( ); # Win32 doesn't export these, so we'll import them manually. BEGIN { no strict 'refs'; *$_ = \&{"Win32::$_"} for qw( GetLongPathName GetFullPathName ); } my $path = "\\DOCUMENTS AND SETTINGS"; # If you wish to keep relative paths relative: print GetLongPathName($path); # If you wish to make relative paths absolute: print GetLongPathName(scalar(GetFullPathName($path)));
Note that Win32's GetCwd returns the path as provided to chdir.
Tested.
In reply to Re: Working directory oddity
by ikegami
in thread Working directory oddity
by teslafreak
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |