Your skill will accomplish what the force of many cannot |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Using the same path you provided avoids confusion. Unix usually does the same thing. If you use /home/ikegami/symlink/dir, it won't magically become /some/where/else/dir. File::Spec definitely won't help, since it doesn't do any system calls. You could always do a directory listing for every component of the path and look for the matching name. That can fail due to permissions and if one of the components is an 8.3 name, but you can always fall back to what you were provided for those components. Finally, so what if you have to branch. You're asking to do something platform-specific, after all. Just hide it in a module with a thin, portable interface. It can call Win32::GetLongPathName on Windows and File::Spec->canonpath on other platforms. In reply to Re^3: Working directory oddity
by ikegami
|
|