* Synchronously opens a file. * @param {string | Buffer | URL} path * @param {string | number} [flags] * @param {string | number} [mode] * @returns {number}
(path, flags, mode)
| 687 | * @returns {number} |
| 688 | */ |
| 689 | function openSync(path, flags, mode) { |
| 690 | flags = stringToFlags(flags); |
| 691 | mode = parseFileMode(mode, 'mode', 0o666); |
| 692 | const h = vfsState.handlers; |
| 693 | if (h !== null) { |
| 694 | const result = h.openSync(path, flags, mode); |
| 695 | if (result !== undefined) return result; |
| 696 | } |
| 697 | return binding.open( |
| 698 | getValidatedPath(path), |
| 699 | flags, |
| 700 | mode, |
| 701 | ); |
| 702 | } |
| 703 | |
| 704 | /** |
| 705 | * @param {string | Buffer | URL } path |
no test coverage detected
searching dependent graphs…