[Development] QFile: writing via a temporary file

David Faure david.faure at kdab.com
Fri Jan 6 18:34:21 CET 2012


On Thursday 05 January 2012 22:38:37 Thiago Macieira wrote:
> On Thursday, 5 de January de 2012 22.48.32, David Faure wrote:
> > Solution 2: how about making this functionality part of QFile itself?
> > No need to "port to another class" anymore, just enable the safety feature
> > by  calling file.setUseTemporaryFile(true).
> 
> What happens if you open the file in read or read-write mode while the flag
> is on?

I think that should just ignore the request for a temp file, since it cannot 
possibly be honoured.

Or if you prefer it could print a warning and fail.

-- 
David Faure | david.faure at kdab.com | KDE/Qt Senior Software Engineer
KDAB (France) S.A.S., a KDAB Group company
Tel. France +33 (0)4 90 84 08 53, Sweden (HQ) +46-563-540090
KDAB - Qt Experts - Platform-independent software solutions




More information about the Development mailing list