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


Groups > comp.lang.python > #35011

Re: Iterating over files of a huge directory

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!194.109.133.86.MISMATCH!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <driscoll@cs.wisc.edu>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'calls.': 0.07; 'seemed': 0.07; '(without': 0.09; 'subject:files': 0.09; 'underlying': 0.09; 'url:github': 0.09; 'cc:addr:python-list': 0.10; 'contribute': 0.10; ':-)': 0.13; 'file,': 0.15; '(also': 0.16; 'benjamin': 0.16; 'cc:name:python list': 0.16; 'driscoll': 0.16; 'filename:fname piece:signature': 0.16; 'iteration': 0.16; 'mine.': 0.16; 'os.walk': 0.16; 'sure.': 0.16; 'thread.': 0.16; 'url:gmane': 0.16; 'url:thread': 0.16; 'wrote:': 0.17; '>>>': 0.18; 'discussion': 0.20; 'thanks.': 0.21; "i'd": 0.22; "haven't": 0.23; 'cc:2**1': 0.24; 'least': 0.25; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'wrote': 0.26; 'am,': 0.27; 'cc:addr:gmail.com': 0.27; 'guess': 0.27; 'separate': 0.27; 'module.': 0.27; 'lines': 0.28; 'initial': 0.28; 'noticed': 0.28; 'record': 0.28; 'finds': 0.29; 'remotely': 0.29; "i'm": 0.29; 'point': 0.31; 'december': 0.32; 'url:python': 0.32; 'directory,': 0.33; 'impression': 0.33; 'anyone': 0.33; 'entry': 0.33; 'thanks': 0.34; 'pm,': 0.35; 'sometimes': 0.35; 'similar': 0.35; 'something': 0.35; 'ability': 0.36; 'but': 0.36; 'wanted': 0.36; 'url:org': 0.36; 'useful': 0.36; "i'll": 0.36; 'too': 0.36; 'possible': 0.37; 'well.': 0.37; 'subject:: ': 0.38; 'think': 0.40; 'most': 0.61; 'information': 0.63; 'subject': 0.66; 'sounds': 0.71; 'goal': 0.74; 'actually,': 0.84; 'oscar': 0.84; 'subject:over': 0.84
Date Mon, 17 Dec 2012 14:09:34 -0600
From Evan Driscoll <driscoll@cs.wisc.edu>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:10.0.11) Gecko/20121116 Thunderbird/10.0.11
MIME-Version 1.0
To Oscar Benjamin <oscar.j.benjamin@gmail.com>
Subject Re: Iterating over files of a huge directory
References <c2b15410-12e0-4645-a77f-9944bfd674a8@googlegroups.com> <CAHVvXxRpG8HDbboCPTuuhMNhZYjewScQW8um1Wz9e90Uv5mQag@mail.gmail.com> <50CF6731.3070705@cs.wisc.edu> <CAHVvXxRxD=vvnSo3YusrD-Vi==joOfO0Asy-AZ94rMC0ngz2cg@mail.gmail.com>
In-Reply-To <CAHVvXxRxD=vvnSo3YusrD-Vi==joOfO0Asy-AZ94rMC0ngz2cg@mail.gmail.com>
X-Enigmail-Version 1.4
Content-Type multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigC6805154389D3554DBEAFD6E"
Cc Gilles Lenfant <gilles.lenfant@gmail.com>, Python List <python-list@python.org>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.989.1355774986.29569.python-list@python.org> (permalink)
Lines 62
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1355774986 news.xs4all.nl 6949 [2001:888:2000:d::a6]:33394
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:35011

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

On 12/17/2012 01:50 PM, Oscar Benjamin wrote:
> On 17 December 2012 18:40, Evan Driscoll <driscoll@cs.wisc.edu> wrote:
>> On 12/17/2012 09:52 AM, Oscar Benjamin wrote:
>>> https://github.com/benhoyt/betterwalk
>>
>> This is very useful to know about; thanks.
>>
>> I actually wrote something very similar on my own (I wanted to get
>> information about whether each directory entry was a file, directory,
>> symlink, etc. without separate stat() calls).
> 
> The initial goal of betterwalk seemed to be the ability to do os.walk
> with fewer stat calls. I think the information you want is part of
> what betterwalk finds "for free" from the underlying OS iteration
> (without the need to call stat()) but I'm not sure.

Yes, that's my impression as well.


>> (Also just for the record and anyone looking for other posts, I'd guess
>> said discussion was on Python-dev. I don't look at even remotely
>> everything on python-list (there's just too much), but I do skim most
>> subject lines and I haven't noticed any discussion on it before now.)
> 
> Actually, it was python-ideas:
> http://thread.gmane.org/gmane.comp.python.ideas/17932
> http://thread.gmane.org/gmane.comp.python.ideas/17757

Thanks again for the pointers; I'll have to go through that thread. It's
possible I can contribute something; it sounds like at least at one
point the implementation was ctypes-based and is sometimes slower, and I
have both a (now-defunct) C implementation and my current Cython module.
Ironically I haven't actually benchmarked mine. :-)

Evan

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


Thread

Iterating over files of a huge directory Gilles Lenfant <gilles.lenfant@gmail.com> - 2012-12-17 07:28 -0800
  Re: Iterating over files of a huge directory Chris Angelico <rosuav@gmail.com> - 2012-12-18 02:41 +1100
    Re: Iterating over files of a huge directory Paul Rudin <paul.nospam@rudin.co.uk> - 2012-12-17 17:27 +0000
      Re: Iterating over files of a huge directory MRAB <python@mrabarnett.plus.com> - 2012-12-17 18:29 +0000
      Re: Iterating over files of a huge directory Chris Angelico <rosuav@gmail.com> - 2012-12-18 08:10 +1100
  Re: Iterating over files of a huge directory Tim Golden <mail@timgolden.me.uk> - 2012-12-17 15:48 +0000
  Re: Iterating over files of a huge directory Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2012-12-17 15:52 +0000
    Re: Iterating over files of a huge directory Gilles Lenfant <gilles.lenfant@gmail.com> - 2012-12-17 08:06 -0800
    Re: Iterating over files of a huge directory Gilles Lenfant <gilles.lenfant@gmail.com> - 2012-12-17 08:06 -0800
  Re: Iterating over files of a huge directory marduk <marduk@python.net> - 2012-12-17 10:50 -0500
  Re: Re: Iterating over files of a huge directory Evan Driscoll <driscoll@cs.wisc.edu> - 2012-12-17 12:40 -0600
  Re: Re: Iterating over files of a huge directory Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2012-12-17 19:50 +0000
  Re: Iterating over files of a huge directory Evan Driscoll <driscoll@cs.wisc.edu> - 2012-12-17 14:09 -0600
  Re: Iterating over files of a huge directory Terry Reedy <tjreedy@udel.edu> - 2012-12-17 16:27 -0500

csiph-web