[Development] QFile: writing via a temporary file

shane.kearns at accenture.com shane.kearns at accenture.com
Fri Jan 6 13:53:27 CET 2012


> On Thu, Jan 05, 2012 at 10:38:37PM -0200, ext Thiago Macieira wrote:
> > What happens if you open the file in read or read-write mode while the
> > flag is on?
> >
> for read-only this is obviously meaningless.
> the mode is inherently incompatible with read-write without truncate.
> in read-write with truncate mode, read operations should simply refer to
> the temporary file. this is consistent with what you would get otherwise
> (you start with an empty file anyway).

Not necessarily, it could make sense to copy the original file to the temporary file in this case.
Some editors do this in order to memory map (sections of) the temp file.


________________________________
Subject to local law, communications with Accenture and its affiliates including telephone calls and emails (including content), may be monitored by our systems for the purposes of security and the assessment of internal compliance with Accenture policy.
______________________________________________________________________________________

www.accenture.com




More information about the Development mailing list