sepia icon indicating copy to clipboard operation
sepia copied to clipboard

EINVAL error in util.js#touchOnHit()

Open mseminatore opened this issue 8 years ago • 2 comments

On Windows with Node v0.12.2 I see an EINVAL error on fs.utimesSync(). I believe the issue is that JavaScript Date.now() returns milliseconds but NodeJS utimesSync expects a Unix timestamp.

mseminatore avatar Dec 01 '16 20:12 mseminatore

I can reproduce this using the following code:

// utimes-test.js
var fs = require('fs');
var now = Date.now();

fs.utimesSync('a.txt', now, now);
console.log("Success!");

c:\sepia-test>echo hello > a.txt c:\sepia-test>node utimes-test.js

mseminatore avatar Dec 02 '16 16:12 mseminatore

@delwyn @salvipriyanka @deepankgupta Are any of you able to integrate the PR and publishing via npm? I'd like to use the library but would like to see this issue fixed.

mseminatore avatar Dec 04 '16 02:12 mseminatore