Our code library, Pear, has been around since 1995. It consists of the building blocks that we've used to create all of our games since Stardock started making games for Windows. There are parts that are outdated, and others that are just junk, but it has served us well and I've been updating it whenever I need it to do just a little bit more. One of the things that makes life easy for us is the library class. The library class ,and any class derived from it, can scan a directory given a mask and build a list of all the files matching that mask. So then when you want to use one of those files later, you can pass it the filename without the path or extension, and it could find it.
This wasn't fully implemented in all the systems, so I've been updating those this week in preparation for being able to read in files from locations outside of the working directory. First, I had to fix a bug in the library where the library expected all filenames to use the DOS naming conventions. Then I made the library search code case insensitive. Finally, I had to deal with a bug that occurred when a filename was truncated because it was too long. So now I can read in files from an outside folder. I pass the directory in to the scan functions for the various systems, and when I ask for a file, I don't care what kind of file it is or where it is, because the system knows that and knows what to do with it. Hey, you Gal Civ modders, remember how you wanted a mods folder so that you could keep a clean copy of Gal Civ? That'll be easy now.
Anyway, the moral of the story is, write a file handling system that isn't case sensitive, use long variables, and update arrays of illegal file characters when your OS updates their lists of illegal file characters.