[Development] QFile: writing via a temporary file

Artur Souza (MoRpHeUz) artur.souza at openbossa.org
Fri Jan 6 21:22:18 CET 2012


On Fri, Jan 6, 2012 at 4:39 PM, David Faure <faure at kde.org> wrote:
> If the app crashes between open and close, i.e. in the middle of the writing
> -- then what you want to open in your text editor, is the existing untouched
> (older) version of the file, NOT the half-written temp file.

"I'm sold" :)

> If the app crashes at any other point, i.e. after close(), and then the
> 'target' file is the one you want to open anyway.
>
> The saving happens into the temp file. So there is nothing "to restore" in case
> of a crash, that's the whole point of not touching the existing file until the
> final atomic renaming.
>
> So in fact I think you're confused about where the writing happens ;)

Got it :) Thanks for the clarification!


-- 
-------------------------------------------------------
Artur Duque de Souza
openBossa
INdT - Instituto Nokia de Tecnologia
-------------------------------------------------------
Blog: http://blog.morpheuz.cc
PGP: 0xDBEEAAC3 @ wwwkeys.pgp.net
-------------------------------------------------------



More information about the Development mailing list