I have part of a build process that creates a hideously long paths in Windows. It\'s not my fault. It\'s several directories deep, and none of the directory names are abnorm
I understand this is not a solution to your specific problem. However, there are a lot of scenarios where being able to map a very long path to a drive-letter would allow one to sidestep the issue and would therefore be useful in dealing with very long path names without having to wade through a whole lot of Windows specific code and docs.
Despite all the effort I put into figuring out how to do this, I am going to recommend somehow using SUBST. Win32::FileOp provides Subst and Unsubst. You can then map the top level working directory to an unused drive letter (which you can find by using Substed). I would start checking with Z and working backwards.
Or, you can shell out, invoke subst utility with no parameters to get a list of current substitutions, choose one that is not there.
None of this is entirely safe as substitutions could change during the build process.