[Tutor] Case Insensitive Globing

Richard Damon Richard at Damon-Family.org
Fri May 17 22:14:12 EDT 2019


I am working on a program to process some files created by an old
windows program that created it files with varying case with a python
program.

Using glob.glob on Windows seems to ignore the case, and find all the
matching files.

The same directory, running the same program under Mac OS X, which also
is a case insensitive file system, is only files that match the case of
the glob, and is missing many of the files that were found under windows.

Is there an easy was to make glob match files as a case insensitive manner?

Or a simple way to do this with something else.

I am trying to do something like:

  for file in glob.glob(pattern): processfile(file)

-- 
Richard Damon



More information about the Tutor mailing list