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

Function access

lib/fs.js:243–258  ·  view source on GitHub ↗

* Tests a user's permissions for the file or directory * specified by `path`. * @param {string | Buffer | URL} path * @param {number} [mode] * @param {(err?: Error) => any} callback * @returns {void}

(path, mode, callback)

Source from the content-addressed store, hash-verified

241 * @returns {void}
242 */
243function access(path, mode, callback) {
244 if (typeof mode === 'function') {
245 callback = mode;
246 mode = F_OK;
247 }
248
249 const h = vfsState.handlers;
250 if (h !== null && vfsVoid(h.access(path, mode), callback)) return;
251
252 path = getValidatedPath(path);
253 callback = makeCallback(callback);
254
255 const req = new FSReqCallback();
256 req.oncomplete = callback;
257 binding.access(path, mode, req);
258}
259
260/**
261 * Synchronously tests a user's permissions for the file or

Callers 1

mainFunction · 0.50

Calls 3

vfsVoidFunction · 0.85
makeCallbackFunction · 0.70
accessMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…