On Mar 18, 2:00 am, Jim Garrison <j...@acm.org> wrote:

>  I don't want "for line in f:" because binary
> files don't necessarily have lines and I'm bulk processing
> files potentially 100MB and larger.  Reading them one line
> at a time would be highly inefficient.
>
> Thanks- Hide quoted text -
>
> - Show quoted text -

For what I know, there are at least two levels of cache between your
application
and the actual file: python interpreter caches its reads, and the
operating system
does that too. So if you are worried about reading efficiently the
file, I think you can stop
worry. Instead, if you are processing files which might not have line
termination at all,
then reading in blocks is the right thing to do.

Ciao
----
FB
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to