Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #64582

Re: Case insensitive exists()?

From Dan Sommers <dan@tombstonezero.net>
Newsgroups comp.lang.python
Subject Re: Case insensitive exists()?
Date 2014-01-23 07:51 +0000
Organization A noiseless patient Spider
Message-ID <lbqhm2$7sf$1@dont-email.me> (permalink)
References <mailman.5853.1390438708.18130.python-list@python.org> <roy-7A7FAE.20082622012014@news.panix.com> <mailman.5855.1390439920.18130.python-list@python.org>

Show all headers | View raw


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 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.

Okay, so it's not Python, and I have the benefit of having read all of
the other answers, but what about calling "locate" [0] with the "-i"
flag? or writing some sort of Python/ctypes wrapper around the part of
locate that searches the database?

Dan

[0] http://savannah.gnu.org/projects/findutils/

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Case insensitive exists()? Larry Martell <larry.martell@gmail.com> - 2014-01-22 17:58 -0700
  Re: Case insensitive exists()? Roy Smith <roy@panix.com> - 2014-01-22 20:08 -0500
    Re: Case insensitive exists()? Larry Martell <larry.martell@gmail.com> - 2014-01-22 18:18 -0700
      Re: Case insensitive exists()? Roy Smith <roy@panix.com> - 2014-01-22 20:27 -0500
        Re: Case insensitive exists()? Larry Martell <larry.martell@gmail.com> - 2014-01-22 21:24 -0700
        Re: Case insensitive exists()? Chris Angelico <rosuav@gmail.com> - 2014-01-23 15:29 +1100
        Re: Case insensitive exists()? Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2014-01-23 15:43 +0000
        Re: Case insensitive exists()? Larry Martell <larry.martell@gmail.com> - 2014-01-23 12:02 -0700
      Re: Case insensitive exists()? Dan Sommers <dan@tombstonezero.net> - 2014-01-23 07:51 +0000
  Re: Case insensitive exists()? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-01-23 12:06 +0000
  Re: Case insensitive exists()? Grant Edwards <invalid@invalid.invalid> - 2014-01-23 14:58 +0000

csiph-web