OldUnreal / UnrealTournamentPatches

Other
972 stars 29 forks source link

[469b] Different cases for Linux files can be problem #256

Open SeriousBuggie opened 3 years ago

SeriousBuggie commented 3 years ago

Historically exists few variant of naming some files. For example:

So server/client must check on start duplicates and if found ambiguous names, then exit with appropriate message to log and stderr. Here example of problem: https://ut99.org/viewtopic.php?p=127462#p127462

Because if loaded not proper version it is Undefined Behavior.

As simplest solution list files all important directories and check for matches in case-insensitive manner.

stijn-volckaert commented 2 years ago

The game's internal file manager already performs case-insensitive file lookups whenever it does not find an exact match. A small script to remove duplicate files would indeed be helpful

an-eternity commented 2 years ago

Anyway, there is a lot of content (maps and mods) that have this problem, which makes it practically impossible to handle it manually, so that script that checks through thousands of these files is a 'musthave' thing.

Simple example to list duplicate files may look like this: find ./System/* -maxdepth 0 -printf '%f\n' | sort -f | uniq -id

Having this list then it is easy to delete these files. Also, it could be improved to check file date, so that to list older file versions...