http://qs321.pair.com?node_id=645901


in reply to Re: Working directory oddity
in thread Working directory oddity

I ran into a similar problem recently. I believe the issue mentioned in the original post "but it returns the directory exectly the way it was typed" is referred to by Microsoft as the feature of being "case insensitive but case preserving". By "case preserving" they do not seem to mean that they preserve the case of the file (or directory) to the case that was used when it was created but that they preserve the case as was used when it was accessed; this is a weird feature.

The "use Win32" solution means that one needs to branch the user-script based on the OS. I tried to solve the problem using

use Cwd qw(getcwd chdir realpath); use File::Spec::Functions; # canonpath

but was not successful -- even canonpath(realpath()) respects the "case preserving" "feature".