MCPcopy Index your code
hub / github.com/nodejs/node / utimesSync

Function utimesSync

lib/fs.js:2641–2655  ·  view source on GitHub ↗

* Synchronously changes the file system timestamps * of the object referenced by `path`. * @param {string | Buffer | URL} path * @param {number | string | Date} atime * @param {number | string | Date} mtime * @returns {void}

(path, atime, mtime)

Source from the content-addressed store, hash-verified

2639 * @returns {void}
2640 */
2641function utimesSync(path, atime, mtime) {
2642 path = getValidatedPath(path);
2643
2644 const h = vfsState.handlers;
2645 if (h !== null) {
2646 const result = h.utimesSync(path, atime, mtime);
2647 if (result !== undefined) return;
2648 }
2649
2650 binding.utimes(
2651 path,
2652 toUnixTimestamp(atime),
2653 toUnixTimestamp(mtime),
2654 );
2655}
2656
2657/**
2658 * Changes the file system timestamps of the object

Callers 2

setDestTimestampsFunction · 0.85
touchHiddenPackageLockFunction · 0.85

Calls 3

toUnixTimestampFunction · 0.85
utimesSyncMethod · 0.45
utimesMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…