Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

nodejs - how to change creation time of file

fsStat class instance returns mtime, atime and ctime date objects, but there seems to be API only for changing mtime and atime (last modification and access i guess). How can i change creation time to create exact copy of file as it'd be also created the same time as original one?

like image 378
Lapsio Avatar asked Aug 25 '14 10:08

Lapsio


1 Answers

It's not possible at present with Node itself, but you can use https://github.com/baileyherbert/utimes (a native add-on for Node) to change the creation time (aka btime) of a file on Windows and Mac.

like image 64
Joran Greef Avatar answered Oct 08 '22 00:10

Joran Greef