Names that break when a storage folder moves between Linux and Windows #14
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Requirement: a storage folder copied between Linux and Windows keeps working.
On Linux the engine, and with it this mod, runs on native Linux .NET (only the renderer runs under Proton), so file names follow Linux rules there. Reproduced against the built mod on Linux .NET and on Windows .NET under Wine:
SanitizeNamecaps names at 120 UTF-16 characters, but Linux allows 255 bytes per file name. 83 Japanese characters (245 bytes) or 60 emoji fail withPathTooLongExceptionon the.partialfile. The 120-character cut can also split an emoji, leaving half a surrogate pair.AUX.old,nul.v2,COM1.5 …save on Linux, but Windows resolves them to the device:Path escapes the storage rootbefore anything is written. A folder holding such a file can't be copied to Windows. COM0, LPT0, COM¹²³, LPT¹²³, CONIN$ and CONOUT$ are missing from the list too.GetUniquePathgiveshat.rlsitemnext toHat.rlsitem, and new folders can do the same; Windows can only hold one of them.A scan of a real storage folder (83,994 entries) found none of these yet.
Not covered here: folder names lose rich text (the in-game folder name is the disk name), and a quoted,
~or relativeStoragePathresolves against the game folder on Linux.GetUniquePath, pending saves and new folders treat names differing only in case as takenFixed in
7df63be(0.7.16), deployed to MonkeyLoader/Mods.Verified:
RLS_ROUNDTRIP_DIRround trip). 14 new checks failed before the fix, for the expected reasons.AUX.oldandnul.v2save as_AUX.old.rlsitemand_nul.v2.rlsitemon both, andhatnext toHatbecomeshat (2)on both.Found while scanning a real storage folder: 6,121 of its 38,536 variant files in
.assets/Variantshave paths over 260 characters under a typical Windows root (the longest is 238 characters relative to the storage root). That's the store layout, not item names, so it's outside this issue.