Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Add option to alter ctime with fs.utimes function (feature-req) #8252

Closed
mheesters opened this issue Aug 24, 2014 · 4 comments
Closed

Add option to alter ctime with fs.utimes function (feature-req) #8252

mheesters opened this issue Aug 24, 2014 · 4 comments

Comments

@mheesters
Copy link

Would it be possible to add the ability alter the creation date of a file through the fs.(f)utimes functions?

Some people using grunt(-contrib-copy) for copying files are looking for a way to keep creation dates.
(gruntjs/grunt-contrib-copy#98)

Currently you can alter atime, mtime but not ctime.

@saghul
Copy link
Member

saghul commented Aug 25, 2014

fs.utimes uses utime(2) (http://linux.die.net/man/2/utime), which doesn't allow you to change the ctime. So I don't see what node / libuv can do here.

@indutny
Copy link
Member

indutny commented Aug 27, 2014

Yeah, agreed. Closing.

@indutny indutny closed this as completed Aug 27, 2014
@jorangreef
Copy link

@mheesters you can use https://github.com/ronomon/utimes which can set the btime (as well as mtime and/or atime) of a file or directory on Windows and macOS.

This is also being worked on in Node but it's pending a change in libuv which is blocked on the next major libuv version: nodejs/node#2600

@mheesters
Copy link
Author

@jorangreef thanks 👍 "beter laat dan nooit" ;)

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

No branches or pull requests

4 participants