in reply to Real Path Name

It looks like Win32::FileOp exports the method Substed, which if invoked on your drive letter will tell you whether it's substed somewhere else, or where the drive mapping leads if it's a network mapped drive. The output syntax is a little odd (in particular it uses windows-native \ for directory separation rather than perl-standard /), but with a little work it should get the job done. Running the following in -e from the command line:
print join(',',Substed(split(/\//,cwd)));
... yields ...
C:\>perl -MCwd -MWin32::FileOp -e "..." ,HarddiskVolume1 X:\>perl -MCwd -MWin32::FileOp -e "..." \??\C:\temp, Z:\>perl -MCwd -MWin32::FileOp -e "..." \??\C:, O:\>perl -MCwd -MWin32::FileOp -e "..." ,LanmanRedirector\;O:000000000002ef75\SOME-MACHINE\Network\Share
Note the comma in the above examples, Substed returns a list of two elements, which I joined with a comma in the output. I've substed X: to C:\temp, Z: to C:\, and O: is a network share.

Replies are listed 'Best First'.
Re^2: Real Path Name
by Anonymous Monk on Mar 09, 2009 at 17:48 UTC
    Thx a lot, bellaire! It seems that that is what I'm looking for, a way to determine if the cwd is a substituted / mapped, or "real" directory.