Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

copy files does not preserve file timestamp #258

Closed
chenlucan opened this issue Jul 8, 2016 · 1 comment
Closed

copy files does not preserve file timestamp #258

chenlucan opened this issue Jul 8, 2016 · 1 comment

Comments

@chenlucan
Copy link

chenlucan commented Jul 8, 2016

The sample code
var fs = require('fs-extra'); fs.copy('explore.jpg', 'explore.fs.extra.jpg', function (err) { if (err) return console.error(err); console.log("success!"); });

The destination file modification time changes to current time.

Is it a way to preserve timestamp? like cp --preserve=timestamps

also please contribute to this question, it mentions about fs-extra
Ctrl+C/V under Gnome vs cp command under linux

@jprichardson
Copy link
Owner

https://github.com/jprichardson/node-fs-extra#copy

preserveTimestamps (boolean): will set last modification and access times to the ones of the original source files, default is false.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants