Author neologix
Recipients eric.araujo, eric.smith, exarkun, giampaolo.rodola, meatballhat, milko.krachounov, neologix, olemis, pitrou, tarek, vstinner
Date 2011-12-23.14:28:37
SpamBayes Score 3.24066e-11
Marked as misclassified No
Message-id <CAH_1eM2HvVYGEf5-T7Oh9vwpjxD9rBws4_-jagokyw1MBJED9Q@mail.gmail.com>
In-reply-to <1324645958.3388.26.camel@localhost.localdomain>
Content
> If you want atomicity to apply to logging,
> you must instead guarantee the durability of each write() call, meaning
> calling fsync() on each logging call

Why so?
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).
You just need to call fsync() once before closing the file, and then
rename it, to ensure that the committed file version is consistent.
In the meantime, you could do whatever you want with the stream (the
hypothetical AtomicFile): seek(), read(), etc. I'm not sure many
methods besides write will be useful, but for example one could easily
imagine that the library expects the passed object to have a fileno()
method.
History
Date User Action Args
2011-12-23 14:28:38neologixsetrecipients: + neologix, exarkun, pitrou, vstinner, eric.smith, giampaolo.rodola, tarek, eric.araujo, olemis, meatballhat, milko.krachounov
2011-12-23 14:28:37neologixlinkissue8604 messages
2011-12-23 14:28:37neologixcreate