Problem with case insensitive volumes

spillz damienlmoore at gmail.com
Tue May 5 17:55:13 CEST 2009


On May 5, 10:02 am, Scott David Daniels <Scott.Dani... at Acm.Org> wrote:
> What is so tough about something like:
>
> base, dirs, files = next(os.walk(dirn))  # older: os.walk(dirn).next()
> current = dict((name.upper() for name in dirs + files)
> ...
> changed = some_name == current[some_name.upper()]
> ...

not so fast. :) Consider:

/my/path/to/usbkey/and/file

everything up to "/my/path/to/usbkey" is case sensitive. only the "and/
file" is case insensitive. but my list of stored paths might include
all images under "/my". thus

/my/path/to/usbkey/and/file1==/my/path/to/usbkey/and/FILE1
/my/path/to/usbkey/and/file1==/my/path/to/usbkey/AND/FILE1
but
/my/path/to/usbkey/and/file1!=/my/path/TO/usbkey/AND/FILE1

so to do this right I'd need to establish which parts of the path are
case insensitive. being able to retrieve the actual path from an
equivalent representation would be so much simpler.



More information about the Python-list mailing list