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

Function futimes

lib/fs.js:2666–2682  ·  view source on GitHub ↗

* Changes the file system timestamps of the object * referenced by the supplied `fd` (file descriptor). * @param {number} fd * @param {number | string | Date} atime * @param {number | string | Date} mtime * @param {(err?: Error) => any} callback * @returns {void}

(fd, atime, mtime, callback)

Source from the content-addressed store, hash-verified

2664 * @returns {void}
2665 */
2666function futimes(fd, atime, mtime, callback) {
2667 atime = toUnixTimestamp(atime, 'atime');
2668 mtime = toUnixTimestamp(mtime, 'mtime');
2669 callback = makeCallback(callback);
2670
2671 const h = vfsState.handlers;
2672 if (h !== null && vfsVoid(h.futimes(fd), callback)) return;
2673
2674 if (permission.isEnabled()) {
2675 callback(new ERR_ACCESS_DENIED('futimes API is disabled when Permission Model is enabled.'));
2676 return;
2677 }
2678
2679 const req = new FSReqCallback();
2680 req.oncomplete = callback;
2681 binding.futimes(fd, atime, mtime, req);
2682}
2683
2684/**
2685 * Synchronously changes the file system timestamps

Callers

nothing calls this directly

Calls 5

toUnixTimestampFunction · 0.85
vfsVoidFunction · 0.85
isEnabledMethod · 0.80
makeCallbackFunction · 0.70
callbackFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…