4 ms·
Windows has a similarly disastrous situation where most tools and APIs follow MAX_PATH - which is defined to be 260 chars. But that doesn't affect the actual fi
by problems 9y ago
Windows has a similarly disastrous situation where most tools and APIs follow MAX_PATH - which is defined to be 260 chars. But that doesn't affect the actual filesystem or syscall interface, just common APIs and tools. This makes it impossible to delete files from windows explorer for example.
If you want to fix this you basically have to bypass it by using "\\?\" on the front of the full path. The situation gets messy when you're trying to write an installer with node packages especially.
https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx#maxpath https://msdn.microsoft.com/en-us/library/windows/desktop/aa3...
- dom0 9y agoThat's an issue that lies in the unfortunate intersection of 16/32 bit Windows, Windows NT and MS libc (MSVCRT), which support some combination of two and a half system designs.
- frik 9y agoMicrosoft could have fixed it with Win 64bit (Win64). They had done such a step before with the switch from Win16 to Win32 and the help of Win32s. With Win32 they cleaned up the old API, fixed things yet kept it source compatible when possible. Microsoft could have fixed so many things with Win64 starting with Windows 2003 64-bit. But no, Microsoft invested little on native Windows API between 2002 and 2012 - Longhorn (later Vista) and dotNet were the latest hype.
- problems 9y agoSeems like they're just starting to fix it now with Win10 and only on applications that ship a special manifest (or on entire machines if you set a specific registry entry).
- mikequinlan 9y agoMicrosoft has partially fixed this in Windows 10 but it is not simple or easy. https://blogs.msdn.microsoft.com/jeremykuhne/2016/07/30/net-4-6-2-and-long-paths-on-windows-10/ https://blogs.msdn.microsoft.com/jeremykuhne/2016/07/30/net-...
- Dylan16807 9y ago> Microsoft could have fixed it with Win 64bit (Win64). Ha, they wouldn't even rename System32 when converting it to 64 bit. There was no chance of an API cleanup.
- yuhong 9y agoIt would not be as simple as you think though. Example: https://msdn.microsoft.com/en-us/library/windows/desktop/bb762181(v=vs.85).aspx https://msdn.microsoft.com/en-us/library/windows/desktop/bb7...
- Tempest1981 9y agoEven using "\\?\" you may hit the max filename limit of NTFS, which is 255 (aka maxComponentLength) ala NAME_MAX. The Win32 error is 123: "The filename, directory name, or volume label syntax is incorrect." https://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx#maxpath https://msdn.microsoft.com/en-us/library/aa365247(VS.85).asp...
- wruza 9y agoI deleted such long paths via moving subdir to root directory first. It seems in that case that directory path was fit, but with filename it overflowed. For very long paths one needs to disassemble it part by part into the root to move or delete. Hanoi tower game built-in.