MDL-43794 Files API Set the mtime of files to extraction time.
The restore cleanup code expects the mtime to be the time of extraction not the mtime before archiving. If set to the old mtime, the restore files may be cleaned up before the restore is complete. This behaviour also matches the behaviour of the zip unpacker.
This commit is contained in:
@@ -456,8 +456,10 @@ class tgz_extractor {
|
||||
'Failed to close output file: ' . $this->currentfile);
|
||||
}
|
||||
|
||||
// Update modified time.
|
||||
touch($this->currentfile, $this->currentmtime);
|
||||
// At this point we should touch the file to set its modified
|
||||
// time to $this->currentmtime. However, when extracting to the
|
||||
// temp directory, cron will delete files more than a week old,
|
||||
// so to avoid problems we leave all files at their current time.
|
||||
}
|
||||
|
||||
if ($this->currentarchivepath === tgz_packer::ARCHIVE_INDEX_FILE) {
|
||||
|
||||
Reference in New Issue
Block a user