Skip to content

Commit 0f2de58

Browse files
sciolistbestander
authored andcommitted
use close instead of finish event for file copy completion (#3234)
Windows Defender updates timestamps on files immediately after a write stream closes. Moving utimes update to after the file has closed corrects this issue.
1 parent 086f9b8 commit 0f2de58

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/util/fs.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ export async function copyBulk(
523523
readStream.pipe(writeStream);
524524
});
525525

526-
writeStream.once('finish', function() {
526+
writeStream.once('close', function() {
527527
fs.utimes(data.dest, data.atime, data.mtime, function(err) {
528528
if (err) {
529529
reject(err);

0 commit comments

Comments
 (0)