2 ms·
Thank you very much for the explanation! I knew I could get away with using forward slashes in Perl and PowerShell, but I had assumed these were hacks in Perl
by krylon 11y ago
Thank you very much for the explanation!
I knew I could get away with using forward slashes in Perl and PowerShell, but I had assumed these were hacks in Perl and Powershell respectively, in order to make Unix-people feel slightly more at home.
> Now, MAX_PATH, that's something else. That should die in a fire and it blows my mind that it hasn't been addressed yet.
In a way, it has. AFAIK, internally Windows can handle paths that are far longer than MAX_PATH, but since so many applications have been written with the assumption that a path can never be longer than MAX_PATH, apparently Microsoft felt if somebody passed a longer path to an API function, that probably indicated some programming error, a buffer overflow or something like that.
But apparently, if you write a path like \\?\C:\Some\Really\Long\Path\With\Lots\Of\Nested\Subdirectories\And\A_Ridiculously_Long_Filename_In_It.RandomLongFileExtension then the path can be fairly long. I think there still is a limit of something like 64KB, but that should, as they say, be enough for anyone. ;-)
Still, I agree, MAX_PATH and network shares have given me a lot of pain - if you have have file server with a folder like D:\Network_Shares\Accounting that is mapped to, say, the drive E: on some client, the client can create files whose local path on the server will exceed MAX_PATH, causing e.g. backup software to choke.
And this happens quite a bit, because our project engineers store project-related files in an elaborate, very deep folder hierarchy; I appreciate they want to organize their files, but sometimes I just want to slap them.