mirror of
https://github.com/abraunegg/onedrive
synced 2024-05-20 06:36:40 +02:00
Check to ensure that file downloaded and is present locally before setting times (Issue #496)
* Check to see if the file was actually downloaded before attempting to set the times on the file. * If file is not local, download failed
This commit is contained in:
parent
3e35e20cc5
commit
f779881ff9
15
src/sync.d
15
src/sync.d
|
@ -1094,11 +1094,20 @@ final class SyncEngine
|
||||||
downloadFailed = true;
|
downloadFailed = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
setTimes(path, item.mtime, item.mtime);
|
// file has to have downloaded in order to set the times / data for the file
|
||||||
|
if (exists(path)) {
|
||||||
|
setTimes(path, item.mtime, item.mtime);
|
||||||
|
} else {
|
||||||
|
log.error("ERROR: File failed to download. Increase logging verbosity to determine why.");
|
||||||
|
downloadFailed = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
writeln("done.");
|
if (!downloadFailed) {
|
||||||
log.fileOnly("Downloading file ", path, " ... done.");
|
writeln("done.");
|
||||||
|
log.fileOnly("Downloading file ", path, " ... done.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// returns true if the given item corresponds to the local one
|
// returns true if the given item corresponds to the local one
|
||||||
|
|
Loading…
Reference in a new issue