Antoine Pitrou <pit...@free.fr> added the comment: > There's no point in calling fsync() after each write, since data is > written to a temporary file which won't be visible before rename(): > even if you call fsync() after each write, if the file is not properly > closed, it won't be committed (i.e.renamed).
Ah, it's a temporary file indeed. But does that mean you can't inspect your logs in real time? All log files I have ever seen are available under their final name while they are still being written to. > In the meantime, you could do whatever you want with the stream (the > hypothetical AtomicFile): seek(), read(), etc. I see. Yes, then an AtomicFile class makes sense (not for logging though, IMHO :-)). And I understand your point about it being available in io or some io submodule (not a 3-level deep one though :-)). Perhaps you want to ask on python-dev? ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue8604> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com