(path, flags, mode)
| 1349 | // Note that unlike fs.open() which uses numeric file descriptors, |
| 1350 | // fsPromises.open() uses the fs.FileHandle class. |
| 1351 | async function open(path, flags, mode) { |
| 1352 | const h = vfsState.handlers; |
| 1353 | if (h !== null) { |
| 1354 | const result = h.promisesOpen(path, flags, mode); |
| 1355 | if (result !== undefined) return result; |
| 1356 | } |
| 1357 | path = getValidatedPath(path); |
| 1358 | const flagsNumber = stringToFlags(flags); |
| 1359 | mode = parseFileMode(mode, 'mode', 0o666); |
| 1360 | return new FileHandle(await PromisePrototypeThen( |
| 1361 | binding.openFileHandle(path, flagsNumber, mode, kUsePromises), |
| 1362 | undefined, |
| 1363 | handleErrorFromBinding, |
| 1364 | )); |
| 1365 | } |
| 1366 | |
| 1367 | async function read(handle, bufferOrParams, offset, length, position) { |
| 1368 | let buffer = bufferOrParams; |
nothing calls this directly
no test coverage detected
searching dependent graphs…