a month or two back where folks were asking to turn os.listdir()
into an iterator (or create an os.xlistdir() or os.iterdir()
function) because directories with lots of files were causing
inordinate slowdown. Yes, listdir() in both 2.x and 3.x both
return lists while such a proposed iterator vers
On Tuesday, 29 September 2009 11:03:17 Tim Chase wrote:
> I think Steven may be remembering the conversation here on c.l.p
> a month or two back where folks were asking to turn os.listdir()
> into an iterator (or create an os.xlistdir() or os.iterdir()
> function) because directories with lots of
Piet van Oostrum wrote:
Steven D'Aprano (SD) wrote:
SD> What you describe is impossible -- os.listdir() returns an ordinary list,
SD> it isn't a lazy iterator that updates automatically as the directory
SD> changes. (At least not in Python2.5 -- I haven't checked Python 3.1.)
He's not usi
> Steven D'Aprano (SD) wrote:
>SD> What you describe is impossible -- os.listdir() returns an ordinary list,
>SD> it isn't a lazy iterator that updates automatically as the directory
>SD> changes. (At least not in Python2.5 -- I haven't checked Python 3.1.)
He's not using Python3, see the
On Tue, 29 Sep 2009 16:03:46 +1000, Chris Adamson wrote:
> Hello,
>
> I am writing code that cycles through files in a directory and for each
> file it writes out another file with info in it. It appears that as I am
> iterating through the list returned by os.listdir it is being updated
> with t
Chris Adamson wrote:
> I am writing code that cycles through files in a directory and for each
> file it writes out another file with info in it. It appears that as I am
> iterating through the list returned by os.listdir it is being updated
> with the new files that are being added to the directo
On Mon, Sep 28, 2009 at 11:03 PM, Chris Adamson
wrote:
> Hello,
>
> I am writing code that cycles through files in a directory and for each file
> it writes out another file with info in it. It appears that as I am
> iterating through the list returned by os.listdir it is being updated with
> the
Hello,
I am writing code that cycles through files in a directory and for each
file it writes out another file with info in it. It appears that as I am
iterating through the list returned by os.listdir it is being updated
with the new files that are being added to the directory. This occurs
e