I’m writing a script which will have to work on directories which are modified by hand by Windows and Linux users alike. The Windows users tend to not care at all about case in assigning filenames.
Is there a way to handle this on the Linux side in Python, i.e. can I get a case-insensitive, glob-like behaviour?
Use case-insensitive regexes instead of glob patterns.
fnmatch.translategenerates a regex from a glob pattern, sogives you a case-insensitive version of a glob pattern as a compiled RE.
Keep in mind that, if the filesystem is hosted by a Linux box on a Unix-like filesystem, users will be able to create files
foo,FooandFOOin the same directory.