* 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)
| 2614 | * @returns {void} |
| 2615 | */ |
| 2616 | function 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 |
no test coverage detected
searching dependent graphs…