Re: Case insensitive exists()?

2014-01-23 Thread Steven D'Aprano
On Wed, 22 Jan 2014 17:58:19 -0700, Larry Martell wrote: I have the need to check for a files existence against a string, but I need to do case-insensitively. Reading on, I see that your database assumes case-insensitive file names, while your file system is case-sensitive. Suggestions:

Re: Case insensitive exists()?

2014-01-23 Thread Tim Chase
On 2014-01-22 17:58, Larry Martell wrote: I have the need to check for a files existence against a string, but I need to do case-insensitively. I cannot efficiently get the name of every file in the dir and compare each with my string using lower(), as I have 100's of strings to check for,

Re: Case insensitive exists()?

2014-01-23 Thread Grant Edwards
On 2014-01-23, Larry Martell larry.mart...@gmail.com wrote: I have the need to check for a files existence against a string, but I need to do case-insensitively. I cannot efficiently get the name of every file in the dir and compare each with my string using lower(), as I have 100's of

Re: Case insensitive exists()?

2014-01-23 Thread Oscar Benjamin
On Wed, Jan 22, 2014 at 09:24:54PM -0700, Larry Martell wrote: I am writing something that is part of a django app, that based on some web entry from the user, I run a query, get back a list of files and have to go receive them and serve them up back to the browser. My script is all done and

Re: Case insensitive exists()?

2014-01-23 Thread Larry Martell
On Wed, Jan 22, 2014 at 9:29 PM, Chris Angelico ros...@gmail.com wrote: On Thu, Jan 23, 2014 at 3:24 PM, Larry Martell larry.mart...@gmail.com wrote: I am writing something that is part of a django app, that based on some web entry from the user, I run a query, get back a list of files and

Case insensitive exists()?

2014-01-22 Thread Larry Martell
I have the need to check for a files existence against a string, but I need to do case-insensitively. I cannot efficiently get the name of every file in the dir and compare each with my string using lower(), as I have 100's of strings to check for, each in a different dir, and each dir can have

Re: Case insensitive exists()?

2014-01-22 Thread Roy Smith
In article mailman.5853.1390438708.18130.python-l...@python.org, Larry Martell larry.mart...@gmail.com wrote: I have the need to check for a files existence against a string, but I need to do case-insensitively. I cannot efficiently get the name of every file in the dir and compare each with

Re: Case insensitive exists()?

2014-01-22 Thread Larry Martell
On Wed, Jan 22, 2014 at 6:08 PM, Roy Smith r...@panix.com wrote: In article mailman.5853.1390438708.18130.python-l...@python.org, Larry Martell larry.mart...@gmail.com wrote: I have the need to check for a files existence against a string, but I need to do case-insensitively. I cannot

Re: Case insensitive exists()?

2014-01-22 Thread Roy Smith
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

Re: Case insensitive exists()?

2014-01-22 Thread MRAB
On 2014-01-23 00:58, Larry Martell wrote: I have the need to check for a files existence against a string, but I need to do case-insensitively. I cannot efficiently get the name of every file in the dir and compare each with my string using lower(), as I have 100's of strings to check for, each

Re: Case insensitive exists()?

2014-01-22 Thread Ethan Furman
On 01/22/2014 04:58 PM, Larry Martell wrote: I have the need to check for a files existence against a string, but I need to do case-insensitively. This should get you going. As it is, it will check the /entire/ string you send in even if it has path parts to it, and there are probably other

Re: Case insensitive exists()?

2014-01-22 Thread Chris Angelico
On Thu, Jan 23, 2014 at 12:27 PM, MRAB pyt...@mrabarnett.plus.com wrote: On 2014-01-23 00:58, Larry Martell wrote: I have the need to check for a files existence against a string, but I need to do case-insensitively. I cannot efficiently get the name of every file in the dir and compare each

Re: Case insensitive exists()?

2014-01-22 Thread Larry Martell
On Wed, Jan 22, 2014 at 6:27 PM, Roy Smith r...@panix.com wrote: 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

Re: Case insensitive exists()?

2014-01-22 Thread Larry Martell
On Wed, Jan 22, 2014 at 6:27 PM, MRAB pyt...@mrabarnett.plus.com wrote: On 2014-01-23 00:58, Larry Martell wrote: I have the need to check for a files existence against a string, but I need to do case-insensitively. I cannot efficiently get the name of every file in the dir and compare each

Re: Case insensitive exists()?

2014-01-22 Thread Chris Angelico
On Thu, Jan 23, 2014 at 3:24 PM, Larry Martell larry.mart...@gmail.com wrote: I am writing something that is part of a django app, that based on some web entry from the user, I run a query, get back a list of files and have to go receive them and serve them up back to the browser. My script is

Re: Case insensitive exists()?

2014-01-22 Thread Dan Sommers
On Wed, 22 Jan 2014 18:18:32 -0700, Larry Martell 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