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

Function fsCall

lib/internal/fs/promises.js:1104–1122  ·  view source on GitHub ↗
(fn, handle, ...args)

Source from the content-addressed store, hash-verified

1102}
1103
1104async function fsCall(fn, handle, ...args) {
1105 assert(handle[kRefs] !== undefined,
1106 'handle must be an instance of FileHandle');
1107
1108 if (handle.fd === -1) {
1109 // eslint-disable-next-line no-restricted-syntax
1110 const err = new Error(handle[kCloseReason] ?? 'file closed');
1111 err.code = 'EBADF';
1112 err.syscall = fn.name;
1113 throw err;
1114 }
1115
1116 try {
1117 handle[kRef]();
1118 return await fn(handle, ...new SafeArrayIterator(args));
1119 } finally {
1120 handle[kUnref]();
1121 }
1122}
1123
1124function checkAborted(signal) {
1125 if (signal?.aborted)

Callers 14

appendFileMethod · 0.85
chmodMethod · 0.85
chownMethod · 0.85
datasyncMethod · 0.85
syncMethod · 0.85
readMethod · 0.85
readvMethod · 0.85
readFileMethod · 0.85
statMethod · 0.85
truncateMethod · 0.85
utimesMethod · 0.85
writeMethod · 0.85

Calls 2

assertFunction · 0.50
fnFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…