зеркало из https://github.com/nextcloud/desktop.git
csync_vio_local_stat: Win: fetch mtime and size if not previously fetched
Since owncloud 2.1, csync_vio_local_stat was optimized because readdir would already fetch most of the info. This works for the discovery, but not later. And we used this function later for symliks and co. So this fixes the .lnk on windows Issue #4300
This commit is contained in:
Родитель
11174ddf4c
Коммит
cf5b1e401c
|
@ -250,6 +250,17 @@ int csync_vio_local_stat(const char *uri, csync_vio_file_stat_t *buf) {
|
|||
/* printf("Index: %I64i\n", FileIndex.QuadPart); */
|
||||
buf->inode = FileIndex.QuadPart;
|
||||
|
||||
if (!(buf->fields & CSYNC_VIO_FILE_STAT_FIELDS_SIZE)) {
|
||||
buf->size = (fileInfo.nFileSizeHigh * ((int64_t)(MAXDWORD)+1)) + fileInfo.nFileSizeLow;
|
||||
buf->fields |= CSYNC_VIO_FILE_STAT_FIELDS_SIZE;
|
||||
}
|
||||
if (!(buf->fields & CSYNC_VIO_FILE_STAT_FIELDS_MTIME)) {
|
||||
DWORD rem;
|
||||
buf->mtime = FileTimeToUnixTime(&fileInfo.ftLastWriteTime, &rem);
|
||||
/* CSYNC_LOG(CSYNC_LOG_PRIORITY_DEBUG, "Local File MTime: %llu", (unsigned long long) buf->mtime ); */
|
||||
buf->fields |= CSYNC_VIO_FILE_STAT_FIELDS_MTIME;
|
||||
}
|
||||
|
||||
c_free_locale_string(wuri);
|
||||
CloseHandle(h);
|
||||
return 0;
|
||||
|
|
|
@ -414,7 +414,7 @@ static qint64 getSizeWithCsync(const QString& filename)
|
|||
&& (stat->fields & CSYNC_VIO_FILE_STAT_FIELDS_SIZE)) {
|
||||
result = stat->size;
|
||||
} else {
|
||||
qDebug() << "Could not get size time for" << filename << "with csync";
|
||||
qDebug() << "Could not get size for" << filename << "with csync";
|
||||
}
|
||||
csync_vio_file_stat_destroy(stat);
|
||||
return result;
|
||||
|
|
Загрузка…
Ссылка в новой задаче