Josiah Carlson wrote: > "Anders J. Munch" <[EMAIL PROTECTED]> wrote: > > 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. > > Every time the length is needed, a system call is required > (you can have > multiple writers of the same file)...
Point taken. It's very rarely a good idea to do so, but the possibility of multiple writers shouldn't be ignored. Still there is no real performance issue. If anything, replacing f.seek(0,2);f.tell() with f.length in various places might save a few system calls. > > Flushing during seek is important. By not flushing during > seek in your > FileBytes object, you are unnecessarily delaying writes, which could > cause file corruption. That's what the flush method is for. The real reason seek implies flush is to save the library author the bother of getting the interactions between input and output buffering right. Anyway, FileBytes has no seek and no concept of current file position, so I really don't know what you're talking about :) - 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
