Add existing to tracked

This commit is contained in:
Jay
2026-08-11 09:53:42 -04:00
parent afe07f3055
commit ffd6e3d73c
8531 changed files with 4396230 additions and 0 deletions
+53
View File
@@ -0,0 +1,53 @@
'use strict'
const fs = require('../fs')
const u = require('universalify').fromPromise
async function utimesMillis (path, atime, mtime) {
const fd = await fs.open(path, 'r+')
let error = null
try {
await fs.futimes(fd, atime, mtime)
} catch (futimesErr) {
error = futimesErr
} finally {
try {
await fs.close(fd)
} catch (closeErr) {
if (!error) error = closeErr
}
}
if (error) {
throw error
}
}
function utimesMillisSync (path, atime, mtime) {
const fd = fs.openSync(path, 'r+')
let error = null
try {
fs.futimesSync(fd, atime, mtime)
} catch (futimesErr) {
error = futimesErr
} finally {
try {
fs.closeSync(fd)
} catch (closeErr) {
if (!error) error = closeErr
}
}
if (error) {
throw error
}
}
module.exports = {
utimesMillis: u(utimesMillis),
utimesMillisSync
}