mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
Logging: Report setModTime failures.
Ths may be helpful for #2252 and maybe even #2431.
This commit is contained in:
parent
b87931c0a9
commit
a49a6bfd88
@ -96,12 +96,18 @@ time_t FileSystem::getModTime(const QString &filename)
|
||||
return result;
|
||||
}
|
||||
|
||||
void FileSystem::setModTime(const QString& filename, time_t modTime)
|
||||
bool FileSystem::setModTime(const QString& filename, time_t modTime)
|
||||
{
|
||||
struct timeval times[2];
|
||||
times[0].tv_sec = times[1].tv_sec = modTime;
|
||||
times[0].tv_usec = times[1].tv_usec = 0;
|
||||
c_utimes(filename.toUtf8().data(), times);
|
||||
int rc = c_utimes(filename.toUtf8().data(), times);
|
||||
if (rc != 0) {
|
||||
qDebug() << "Error setting mtime for" << filename
|
||||
<< "failed: rc" << rc << ", errno:" << errno;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool FileSystem::renameReplace(const QString& originFileName, const QString& destinationFileName, QString* errorString)
|
||||
|
||||
@ -40,7 +40,7 @@ void OWNCLOUDSYNC_EXPORT setFileHidden(const QString& filename, bool hidden);
|
||||
*/
|
||||
time_t OWNCLOUDSYNC_EXPORT getModTime(const QString &filename);
|
||||
|
||||
void setModTime(const QString &filename, time_t modTime);
|
||||
bool setModTime(const QString &filename, time_t modTime);
|
||||
|
||||
/**
|
||||
* Rename the file \a originFileName to \a destinationFileName, and overwrite the destination if it
|
||||
|
||||
Loading…
Reference in New Issue
Block a user