How to use the futimes function from fs
Find comprehensive JavaScript fs.futimes code examples handpicked from public code repositorys.
GitHub: nwjs/node
111 112 113 114 115 116 117 118 119
fd = fs.openSync(tmpdir.path, 'r+'); } else { fd = fs.openSync(tmpdir.path, 'r'); } fs.futimes(fd, atime, mtime, common.mustCall((err) => { expect_ok('futimes', fd, err, atime, mtime); syncTests();
42
19
0
+ 5 other calls in file
838 839 840 841 842 843 844 845 846 847
assert.strictEqual(err.syscall, 'futime'); return true; }; common.runWithInvalidFD((fd) => { fs.futimes(fd, new Date(), new Date(), common.mustCall(validateError)); assert.throws( () => fs.futimesSync(fd, new Date(), new Date()), validateError
42
19
0
411 412 413 414 415 416 417 418 419
if (entry.mtime && !this.noMtime) { actions++ const atime = entry.atime || new Date() const mtime = entry.mtime fs.futimes(fd, atime, mtime, er => er ? fs.utimes(abs, atime, mtime, er2 => done(er2 && er)) : done()) }
3
2
0
114 115 116 117 118 119 120 121 122 123 124
function futime() { const fs = require('fs'); fs.writeFileSync('fs11.txt', '123', 'utf8'); const fd = fs.openSync('fs11.txt', 'r+'); fs.futimes(fd, 1, 1, () => { fs.unlinkSync('fs11.txt'); }); }
0
0
0
+ 2 other calls in file
GitHub: EzSylester/Node
125 126 127 128 129 130 131 132 133 134
} fs.futimes(fd, atime, mtime, function(err) { expect_ok('futimes', fd, err, atime, mtime); fs.futimes(-1, atime, mtime, function(err) { expect_errno('futimes', -1, err, 'EBADF'); syncTests(); callback(); });
0
0
0
fs.readFileSync is the most popular function in fs (2736 examples)