Skip to content

Commit

Permalink
Preserve file timestamp on copy.
Browse files Browse the repository at this point in the history
  • Loading branch information
goloroden committed May 29, 2015
1 parent a4dae1d commit d40bdf9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/_copy.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ function ncp (source, dest, options, callback) {
// presumably old node then
var eventName = global.setImmediate ? 'finish' : 'close'
writeStream.once(eventName, function () {
var stat = fs.lstatSync(file.name);
fs.utimesSync(target, stat.atime, stat.mtime);
cb()
})
}
Expand Down

0 comments on commit d40bdf9

Please sign in to comment.