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