Index: sources/storage/FileHandler.cpp =================================================================== diff -u -re38423dd3840e625ed0728d9b0fb3f9eb9292500 -r95d717f975007dad9c7ab1450863b1dfdf627790 --- sources/storage/FileHandler.cpp (.../FileHandler.cpp) (revision e38423dd3840e625ed0728d9b0fb3f9eb9292500) +++ sources/storage/FileHandler.cpp (.../FileHandler.cpp) (revision 95d717f975007dad9c7ab1450863b1dfdf627790) @@ -98,7 +98,7 @@ { QFile file(vFileName); if (! file.open(QFile::Text | QFile::ReadOnly)) { - QString msg = QString("Cannot open file for write (%1). Possible corrupted file system").arg(vFileName); + QString msg = QString("Cannot open file for read (%1). Possible corrupted file system").arg(vFileName); // here cannot use LOG_XXXX because if the folder cannot be created then the log cannot be written. errOut (msg); return false; @@ -114,6 +114,23 @@ } /*! + * \brief FileHandler::backupFile + * \details Calls the gzip command + * the file is compressed and will be deleted by gzip + * the destination file is determined by gzip + * \param vSource - file to be compressed + * \return non-zero if successfull. + */ +int FileHandler::backupFile(const QString &vSource) +{ + QString cmd = "gzip"; + QStringList arguments; + arguments << vSource; + int result = QProcess::execute(cmd, arguments); + return result; +} + +/*! * \brief FileHandler::copyFolder * \details Copies all the file and folders recursively. * \param vSource - The source folder