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

Method openSync

lib/internal/vfs/file_system.js:574–578  ·  view source on GitHub ↗

* Opens a file synchronously and returns a file descriptor. * @param {string} filePath The path to open * @param {string} [flags] Open flags * @param {number} [mode] File mode * @returns {number} The file descriptor

(filePath, flags = 'r', mode)

Source from the content-addressed store, hash-verified

572 * @returns {number} The file descriptor
573 */
574 openSync(filePath, flags = 'r', mode) {
575 const providerPath = this.#toProviderPath(filePath);
576 const handle = this[kProvider].openSync(providerPath, flags, mode);
577 return openVirtualFd(handle);
578 }
579
580 /**
581 * Closes a file descriptor synchronously.

Callers 2

truncateSyncMethod · 0.45
openMethod · 0.45

Calls 2

#toProviderPathMethod · 0.95
openVirtualFdFunction · 0.85

Tested by

no test coverage detected