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

Function close

lib/internal/fs/streams.js:118–128  ·  view source on GitHub ↗
(stream, err, cb)

Source from the content-addressed store, hash-verified

116};
117
118function close(stream, err, cb) {
119 if (!stream.fd) {
120 cb(err);
121 } else if (stream.flush) {
122 stream[kFs].fsync(stream.fd, (flushErr) => {
123 _close(stream, err || flushErr, cb);
124 });
125 } else {
126 _close(stream, err, cb);
127 }
128}
129
130function _close(stream, err, cb) {
131 stream[kFs].close(stream.fd, (er) => {

Callers 2

streams.jsFile · 0.70
closeMethod · 0.50

Calls 3

fsyncMethod · 0.80
_closeFunction · 0.70
cbFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…