[Tutor] open/closing files and system limits

Wes Bateman wbateman@epicrealm.com
Wed, 13 Sep 2000 17:52:01 -0500 (CDT)


Thanks for the help :)  That's interesting.  I set the (8192) after
readlines and it came back in .3 seconds.  It didn't do all of the files
in the list though.  It did the first 146 items, then stopped.  I
experimented with numbers other than 8192 and it always stopped in the
same place.  :( ?  I don't get it.  I didn't see reference to this in the
FAQ either, I'd like to read more about it though.

My catalog file is just under 1100 lines and each file it parses is approx
36 lines long.  The blocksize (or whatever that is called) in the
parentheses makes a HUGE performance difference, but I'm not understanding
why it doesn't complete the whole job.

Thanks for any additional insight :)

Wes

On Wed, 13 Sep 2000, Michael P. Reilly wrote:
<SNIP>
> 
> I think this is in the FAQ somewhere as a performance problem.  There
> are a few solutions, but my "favorite" is:
>   for lines in catalog.readlines(8192):  # get a "block" of lines
>     for line in lines:
>       file = open(line[:-1])
>       ...
> 
>   -Arcege
> 
>