Hacker News new | ask | show | jobs
by bmeck 4106 days ago
Once again, these limitations are not with Windows itself (see all the C++ Unicode file functions / file longpaths). In general Node supports long paths just fine (you can watch `npm` write past the 260 [wtf?] char limit). The limitation is in other programs trying to respect MAXPATH even when they should be moving to Unicode functions for compatibility reasons / lack of knowledge. It should be noted that compatibility breaks not just from long paths causing errors, but automatic file expansion does not occur on long paths. So we get into even more special snowflake situations where sometimes files with expansions work with older functions but not with newer ones.

But the fact that Unicode functions don't expand adds an interesting problem for us; the MAXPATH respecting (and outdated) _A filesystem functions can cause a collision for non-expanded paths we get to fun things where you can have different FILE objects if you use old _A functions vs _W functions. The inverse is also true where you can collide by moving from _W to _A.

So! If we do start using old _A functions we actually can cause problems by directing to new files that would cause expansion because of file expansion being turned on.

* https://msdn.microsoft.com/en-us/library/windows/desktop/aa3...

* https://msdn.microsoft.com/en-us/library/ms813802.aspx

PS. Don't get me started on FS permissions...