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

Function openSync

lib/fs.js:689–702  ·  view source on GitHub ↗

* Synchronously opens a file. * @param {string | Buffer | URL} path * @param {string | number} [flags] * @param {string | number} [mode] * @returns {number}

(path, flags, mode)

Source from the content-addressed store, hash-verified

687 * @returns {number}
688 */
689function 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

Callers 4

benchFromSyncWritevFunction · 0.50
mainFunction · 0.50
fooFunction · 0.50
fooFunction · 0.50

Calls 4

stringToFlagsFunction · 0.85
parseFileModeFunction · 0.85
openMethod · 0.65
openSyncMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…