How to use the utimesSync function from fs
Find comprehensive JavaScript fs.utimesSync code examples handpicked from public code repositorys.
GitHub: blockcollider/bcnode
91 92 93 94 95 96 97 98 99 100
exports.truncateSync = fs.truncateSync; exports.unlink = co.promisify(fs.unlink); exports.unlinkSync = fs.unlinkSync; exports.unwatchFile = fs.unwatchFile; exports.utimes = co.promisify(fs.utimes); exports.utimesSync = fs.utimesSync; exports.watch = fs.watch; exports.watchFile = fs.watchFile; exports.write = co.promisify(fs.write); exports.writeSync = fs.writeSync;
22
45
26
GitHub: nwjs/node
126 127 128 129 130 131 132 133 134 135
// // test synchronized code paths, these functions throw on failure // function syncTests() { fs.utimesSync(pathType(tmpdir.path), atime, mtime); expect_ok('utimesSync', tmpdir.path, undefined, atime, mtime); fs.lutimesSync(pathType(lpath), atime, mtime); expect_ok('lutimesSync', lpath, undefined, atime, mtime, fs.lstatSync);
42
19
0
+ 7 other calls in file
627 628 629 630 631 632 633 634 635 636 637 638
fs.utimes(nonexistentFile, new Date(), new Date(), common.mustCall(validateError)); assert.throws( () => fs.utimesSync(nonexistentFile, new Date(), new Date()), validateError ); }
42
19
0
761 762 763 764 765 766 767 768 769 770
const mtime = entry.mtime try { fs.futimesSync(fd, atime, mtime) } catch (futimeser) { try { fs.utimesSync(entry.absolute, atime, mtime) } catch (utimeser) { er = futimeser } }
3
2
0
GitHub: Siykt/react
50 51 52 53 54 55 56 57 58 59
} fs.unlinkSync(destPath); fs.copyFileSync(srcPath, destPath); // Set the mtime of the copied file to be same as the original file, // so that the above check works. fs.utimesSync(destPath, srcStat.atime, srcStat.mtime); } } else { fs.copyFileSync(srcPath, destPath); fs.utimesSync(destPath, srcStat.atime, srcStat.mtime);
0
1
0
+ 3 other calls in file
GitHub: EzSylester/Node
89 90 91 92 93 94 95 96 97 98
} var err; err = undefined; try { fs.utimesSync('foobarbaz', atime, mtime); } catch (ex) { err = ex; } expect_errno('utimesSync', 'foobarbaz', err, 'ENOENT');
0
0
0
fs.readFileSync is the most popular function in fs (2736 examples)