Greg Ewing wrote: > Anders J. Munch wrote: > > any file that supports seeking to the end will also support > > reporting the file size. Thus > > f.seek(f.length) > > should suffice, > > Although the micro-optimisation circuit in my > brain complains that it will take 2 system > calls when it could be done with 1...
I don't expect file methods and systems calls to map one to one, but you're right, the first time the length is needed, that's an extra system call. My micro-optimisation circuitry blew a fuse when I discovered that seek always implies flush. You won't get good performance out of code that does a lot of seeks, whatever you do. Use my upcoming FileBytes class :) - Anders _______________________________________________ Python-3000 mailing list [email protected] http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com
