[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    should KSaveFile::simpleBackupFile overwrite old backups?
From:       Robby Stephenson <robby () periapsis ! org>
Date:       2008-12-23 15:33:58
Message-ID: 200812230733.58424.robby () periapsis ! org
[Download RAW message or body]

Hi,

I've run into some behavior with the KSaveFile::simpleBackupFile() 
functionality that I wanted to ask about. Essentially, the function doesn't 
do much more than append a backup extension (default is '~'), optionally 
modify the path, and then call QFile::copy().

What I've run into is that QFile::copy returns false if the file exists. So 
while I would have expected repeated calls to simpleBackupFile() to 
repeatedly copy the existing file to the backup, it actually fails if the 
backup already exists. Am I reading that right?

Is that the intended behavior? If so, perhaps we could add a note to the API 
saying the developer is expected to call QFile::remove() before backing up 
the file?

The KSaveFile::numberedBackupFile() function _does_ remove old copies first.

Thanks,
Robby
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic