Message150164
> 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? |
|
Date |
User |
Action |
Args |
2011-12-23 14:40:42 | pitrou | set | recipients:
+ pitrou, exarkun, vstinner, eric.smith, giampaolo.rodola, tarek, eric.araujo, olemis, meatballhat, milko.krachounov, neologix |
2011-12-23 14:40:41 | pitrou | link | issue8604 messages |
2011-12-23 14:40:41 | pitrou | create | |
|