Microsoft Removes 260-Character Path Length Limit in Windows 10 Redstone
news.softpedia.com
news.softpedia.com
Windows currently doesn't have a 260 character path length limit. However some legacy Win32 APIs only support up to 260 characters for backwards compatibility and old file system reasons.
If you use UNC paths you can have a path with 32,767 characters in it, 255 characters per element (e.g. a single folder/file name of 255 characters).
To quote MSDN:
> The Windows API has many functions that also have Unicode versions to permit an extended-length path for a maximum total path length of 32,767 characters. This type of path is composed of components separated by backslashes, each up to the value returned in the lpMaximumComponentLength parameter of the GetVolumeInformation function (this value is commonly 255 characters). To specify an extended-length path, use the "\\?\" prefix. For example, "\\?\D:\very long path".
All this GPO policy does it change existing non-unicode Win32 APIs to support paths beyond the 260 character limit. However this likely won't work on pre-Windows 10 versions of Windows, non-NTFS filesystems, and just having long file/folder names may within itself break older software.
Legacy or not, this affects all .NET applications and also to some extent NodeJS (with its crazy node_moules mess) and you have to apply all kinds of crazy workarounds for this not to come back and bite you.
The amount of builds I've seen broken over stuff like this is ridiculous.
If they can get this fixed proper, I'd love to offer the MS engineer who made this happen a beer or twelve.
https://www.microsoft.com/resources/documentation/windows/xp...
Although installing MSYS2 http://msys2.github.io/ provides a far superior command line environment IMO and then you can just use rm.
If you have 7-zip installed, you can open the parent directory in 7-zip file manager and delete it from there.
So \a_quite\long\path\with_files\module.js becomes \a\a\a\a\module.js
And you can usually delete that quite fine.
It's terrible. It's ugly. But it works.
this was on windows 7 though and relatively recently, perhaps it's better in 8 and 10.
I realize that you're saying that Win32 doesn't have a hard limit of MAX_PATH since you can use Win32 file namespace paths (the `\\?\` prefix) to specify long paths. And yes, that's technically correct, you can. But realistically, unless you carefully control the paths that you're writing and no other program is using them, you're pretty much shooting yourself in the foot by trying to do that.
This is because most apps simply use the Win32 APIs with normal paths and not Win32 file namespace paths. So sure - you can write a file that has a name that's 1024 characters, or a file named `CON`, or a file named `hello?`, but only other programs that wisely use `\\?\` paths can do anything with that. Which is basically nothing except the program you just wrote.
It certainly doesn't include almost anything that Windows itself put down during installation. `cmd`, the Windows Shell, the whole of the CLR? None of these can read the file you just wrote.
So the title seems quite accurate to me.
"If you have ever needed to work with UNC paths in a Python script for Windows, you might have experienced the same dilemma that we did. What’s the problem? Python has virtually no support for UNC."
http://developer.covenanteyes.com/unc-paths-with-python/
"As tiny as our minority might be, we wanted to deal with these difficulties once and for all. I introduce to you the win_unc library."
These are sometimes erroneously called UNC paths because, well, they _look_ like UNC paths. But UNC paths are used to refer to a path on another host. (In fact, you can specify UNC paths using the Win32 file namespace using the `\\?\UNC\server\resource` mechanism.)
It looks like win_unc will help with UNC, but it looks from a quick glance that it will not help with `\\?\` paths.
(I don't even use node, but if a project I'm interested in has a bunch of node modules in it, I'll have to stop and spend time to fight the path length errors.)
I edited my original post accordingly, changing it to a more reminiscent tone.
[1] https://www.microsoft.com/resources/documentation/windows/xp...
It'll be great - like the 8.3 transition all over again!
So if it doesn't have the manifest entry, the program will be assumed to not handle longer paths.
That puzzles me, then - why have a registry key to toggle being able to manifest that at all?
The more interesting question is why doesn't this build default that registry key to On in this Build. My presumption here is that the Win32 subsystem changes are possibly significant and there are some backwards compatibility concerns and so this is "feature flagged" until it's been tested more in labs/real world exposure.
EDIT: I don't think it would go down well, if some files cannot be opened in all applications only because of the path. I mean, Windows is the biggest enviroment for the most diverse set of desktop applications right now, so refusing to open files because your app doesn't support the path sounds unreasonable but I cannot think of a solution myself. Thus I'd like to know how they're approaching this.
That's why "Bash on Windows" will likely never be used in a production environment, and personally as a developer I see it as creating more problems than it solves. Because it can't be used in production you're limited to apps that either run in Linux or run in Windows, but not apps that take advantage of both systems.
In the end I mostly just end up using Linux to program apps that won't even run on desktop Windows (do people still develop desktop app for windows and make money doing it?). I do webdev, android, iOS, and some enterprise network applications. I don't even really need the windows desktop.
If MS wants to attract developers they should fix the font rendering.
Absolutely. I sell a small utility application that's a native Windows application.
Just out of personal curiosity but what is BB developed with?
I have been doing Windows desktop development in the last three years and there are lots of requests for doing so in the enterprise space.
More than we can fulfill actually.
When I was finished, I tried to delete bower, but Windows wouldn't let me. It had installed all of its dependencies, which had installed dependencies of their own, each one nested deeper and deeper, node_modules after node_modules, far exceeding 260 characters.
I forget what trickery I had to resort to in order to delete that folder. It took a bit of Googling and I had to follow instructions I found on StackOverflow.
Would've been nice if Windows wouldn't have let them do that in the first place (given the constraint on file paths).
MS tries to keep backward compatibility at an almost obsessive level, warts and all. The unfortunate thing about maintaining backward compatibility to an almost obsessive level is that you get artifacts like this limit. While the limit should have been removed some time ago, it became so known, easy to work around, and seldom encountered that it was felt to cause more problems than it solved.
If someone ported software to Linux from Windows, without taking into account that Linux cares about the upper case and lower case letters in filename and paths, then you can't really claim that it's Linux that's broken.
Ummm, not so sure considering all those modules still worked when you'd require them in node. The problem was that you couldn't easily delete those files from the file system. So it is actually the fault of the OS for allowing you to create those files/folders if it wasn't going to also be able to handle deleting them.
I do web development on Windows using Java and .NET stacks, never had the problem.