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

Function utimes

lib/fs.js:2616–2631  ·  view source on GitHub ↗

* 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 * @param {(err?: Error) => any} callback * @returns {void}

(path, atime, mtime, callback)

Source from the content-addressed store, hash-verified

2614 * @returns {void}
2615 */
2616function utimes(path, atime, mtime, callback) {
2617 callback = makeCallback(callback);
2618 path = getValidatedPath(path);
2619
2620 const h = vfsState.handlers;
2621 if (h !== null && vfsVoid(h.utimes(path, atime, mtime), callback)) return;
2622
2623 const req = new FSReqCallback();
2624 req.oncomplete = callback;
2625 binding.utimes(
2626 path,
2627 toUnixTimestamp(atime),
2628 toUnixTimestamp(mtime),
2629 req,
2630 );
2631}
2632
2633/**
2634 * Synchronously changes the file system timestamps

Callers 1

doTestFunction · 0.50

Calls 4

vfsVoidFunction · 0.85
toUnixTimestampFunction · 0.85
makeCallbackFunction · 0.70
utimesMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…