I am currently experiencing a failure during the cooking on my data from CookCommandlet.cpp saying:
Couldn’t save package, filename is too long
It is true that my path is long, it is just a bit over the MAX_PATH defined in Windows at 260 characters.
However in these modern days, a long folder hierarchy shouldn’t prevent a build from working so I was trying to fix it, and I discovered that Unreal calls MoveFileW in WindowsPlatformFile.cpp, and this is where it fails.
The Windows documentation mentions that:
“In the ANSI version of this function, the name is limited to MAX_PATH characters. To extend this limit to 32,767 wide characters, call the Unicode version of the function and prepend “\?” to the path. For more information, see Naming a File.”
So basically I was wondering: if I modify NormalizeFilename() so it would always prepend “\?” to all paths, would that fix everything?
If so, would Epic prefer to do it in their codebase, or are there other dangers lurking?