In article <mailman.5855.1390439920.18130.python-l...@python.org>, Larry Martell <larry.mart...@gmail.com> wrote:
> The issue is that I run a database query and get back rows, each with > a file path (each in a different dir). And I have to check to see if > that file exists. Each is a separate search with no correlation to the > others. I have the full path, so I guess I'll have to do dir name on > it, then a listdir then compare each item with .lower with my string > .lower. It's just that the dirs have 100's and 100's of files so I'm > really worried about efficiency. Oh, my, this is a much more complicated problem than you originally described. Is the whole path case-insensitive, or just the last component? In other words, if the search string is "/foo/bar/my_file_name", do all of these paths match? /FOO/BAR/MY_FILE_NAME /foo/bar/my_file_name /FoO/bAr/My_FiLe_NaMe Can you give some more background as to *why* you're doing this? Usually, if a system considers filenames to be case-insensitive, that's something that's handled by the operating system itself. -- https://mail.python.org/mailman/listinfo/python-list