How to use the futimesSync function from fs
Find comprehensive JavaScript fs.futimesSync code examples handpicked from public code repositorys.
GitHub: blockcollider/bcnode
52 53 54 55 56 57 58 59 60 61
exports.fsync = co.promisify(fs.fsync); exports.fsyncSync = fs.fsyncSync; exports.ftruncate = co.promisify(fs.ftruncate); exports.ftruncateSync = fs.ftruncateSync; exports.futimes = co.promisify(fs.futimes); exports.futimesSync = fs.futimesSync; exports.lchmod = co.promisify(fs.lchmod); exports.lchmodSync = fs.lchmodSync; exports.lchown = co.promisify(fs.lchown); exports.lchownSync = fs.lchownSync;
22
45
26
GitHub: nwjs/node
135 136 137 138 139 140 141 142 143 144
expect_ok('lutimesSync', lpath, undefined, atime, mtime, fs.lstatSync); // Some systems don't have futimes // if there's an error, it should be ENOSYS try { fs.futimesSync(fd, atime, mtime); expect_ok('futimesSync', fd, undefined, atime, mtime); } catch (ex) { expect_errno('futimesSync', fd, ex, 'ENOSYS'); }
42
19
0
+ 5 other calls in file
841 842 843 844 845 846 847 848 849 850 851 852
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
758 759 760 761 762 763 764 765 766 767
// if either fails, handle the first error if (entry.mtime && !this.noMtime) { const atime = entry.atime || new Date() const mtime = entry.mtime try { fs.futimesSync(fd, atime, mtime) } catch (futimeser) { try { fs.utimesSync(entry.absolute, atime, mtime) } catch (utimeser) {
3
2
0
GitHub: EzSylester/Node
98 99 100 101 102 103 104 105 106 107
expect_errno('utimesSync', 'foobarbaz', err, 'ENOENT'); tests_run++; err = undefined; try { fs.futimesSync(-1, atime, mtime); } catch (ex) { err = ex; } expect_errno('futimesSync', -1, err, 'EBADF');
0
0
0
fs.readFileSync is the most popular function in fs (2736 examples)