Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Exactly; that's the problem. The usual correct way in Windows of calling the function with `NULL` to get the length, then allocating the buffer and passing it back in, is wicked annoying with path names, so most developers simply don't bother.

Interestingly, while that problem doesn't exist in .NET, and so you'd think that .NET would finally support long file names by default, Microsoft actually goes entirely the opposite direction: the BCL strips out any leading `\\?\` in paths to force you to stay at MAX_PATH or below. The more things change...



You know there's a way around having to do those things every time you use CreateFile, right? It's a neat thing they invented many moons ago, starts with an F and ends with "nction".


Which leads to an ever-growing file called "Utilities.cpp" that gets copied into every C++ project you ever write and god forbid there's ever a bug fix you have to do because it now needs to be applied to 20 separate projects in 20 separate version control systems.


There are ways around having to apply a patch 20 times, too. Libraries and git submodules to name a few.

Secondly, if you use 20 version control systems, you're doing it horribly, horribly wrong.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: