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

Function fsync

lib/fs.js:1538–1551  ·  view source on GitHub ↗

* Requests for all data for the open file descriptor * to be flushed to the storage device. * @param {number} fd * @param {(err?: Error) => any} callback * @returns {void}

(fd, callback)

Source from the content-addressed store, hash-verified

1536 * @returns {void}
1537 */
1538function fsync(fd, callback) {
1539 callback = makeCallback(callback);
1540
1541 const h = vfsState.handlers;
1542 if (h !== null && vfsVoid(h.fsync(fd), callback)) return;
1543
1544 const req = new FSReqCallback();
1545 req.oncomplete = callback;
1546 if (permission.isEnabled()) {
1547 callback(new ERR_ACCESS_DENIED('fsync API is disabled when Permission Model is enabled.'));
1548 return;
1549 }
1550 binding.fsync(fd, req);
1551}
1552
1553/**
1554 * Synchronously requests for all data for the open

Callers

nothing calls this directly

Calls 5

vfsVoidFunction · 0.85
fsyncMethod · 0.80
isEnabledMethod · 0.80
makeCallbackFunction · 0.70
callbackFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…