[2.0.55]Mod breaks reading capitalized extensions only when in a .zip

Bugs that are actually features.
User avatar
Fishbus
Inserter
Inserter
Posts: 31
Joined: Sat Sep 28, 2024 8:20 pm
Contact:

[2.0.55]Mod breaks reading capitalized extensions only when in a .zip

Post by Fishbus »

Heya,

Really weird interaction inside a mod I am working on recently.

I had an external blender script change some files from "filename.png" to "filename.PNG"

This continues to work if the mod is extracted inside the mod folder (i.e. during development ...Factorio/mods/mod_name_2.2.1/... ), but when the folder is zipped up into an archive and the mod attempts to open it (...Factorio/mods/mod_name_2.2.1.zip), the case sensitivity of the extension stops the mod from loading (it cannot find the file).

It's not a wild issue, I presume also referring explicitly the case sensitivity in the mod data would also fix it. But it was an odd quirk that caught me off guard and thought I'd bring awareness to it.

Cheers
danbopes
Fast Inserter
Fast Inserter
Posts: 108
Joined: Mon Feb 07, 2022 9:29 pm
Contact:

Re: [2.0.55]Mod breaks reading capitalized extensions only when in a .zip

Post by danbopes »

Filenames in windows are case insensitive so when searching if a file exists and loading, filenames don't care about case. This is not the case for zip files, because the files are explicitly loaded via code.

Regardless, if this was fixed to do case-insensitive matching on windows, the mod would still be broken on other operating systems like Linux. I would consider this a non-issue.
Post Reply

Return to “Not a bug”