MCPcopy Create free account
hub / github.com/nodejs/node / chown

Function chown

lib/internal/fs/promises.js:1937–1952  ·  view source on GitHub ↗
(path, uid, gid)

Source from the content-addressed store, hash-verified

1935}
1936
1937async function chown(path, uid, gid) {
1938 const h = vfsState.handlers;
1939 if (h !== null) {
1940 const promise = h.chown(path, uid, gid);
1941 if (promise !== undefined) { await promise; return; }
1942 }
1943
1944 path = getValidatedPath(path);
1945 validateInteger(uid, 'uid', -1, kMaxUserId);
1946 validateInteger(gid, 'gid', -1, kMaxUserId);
1947 return await PromisePrototypeThen(
1948 binding.chown(path, uid, gid, kUsePromises),
1949 undefined,
1950 handleErrorFromBinding,
1951 );
1952}
1953
1954async function utimes(path, atime, mtime) {
1955 path = getValidatedPath(path);

Callers

nothing calls this directly

Calls 1

chownMethod · 0.45

Tested by

no test coverage detected