in reply to Re^2: Working directory oddity
in thread Working directory oddity
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Working directory oddity
by sg (Pilgrim) on Oct 19, 2007 at 15:07 UTC | |
by ikegami (Patriarch) on Oct 19, 2007 at 15:12 UTC | |
by sg (Pilgrim) on Oct 19, 2007 at 15:28 UTC |