diff --git a/src/sync.d b/src/sync.d index 3eee1c7e..92bfffd3 100644 --- a/src/sync.d +++ b/src/sync.d @@ -1094,11 +1094,20 @@ final class SyncEngine downloadFailed = true; 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."); - log.fileOnly("Downloading file ", path, " ... done."); + if (!downloadFailed) { + writeln("done."); + log.fileOnly("Downloading file ", path, " ... done."); + } } // returns true if the given item corresponds to the local one