MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / close

Function close

src/lib/libnoderawfs.js:198–206  ·  view source on GitHub ↗
(stream)

Source from the content-addressed store, hash-verified

196 */
197 $NODERAWFS_stream_funcs: {
198 close(stream) {
199 VFS.closeStream(stream.fd);
200 // Don't close stdin/stdout/stderr since they are used by node itself.
201 if (--stream.shared.refcnt <= 0 && stream.nfd > 2) {
202 // This stream is created by our Node.js filesystem, close the
203 // native file descriptor when its reference count drops to 0.
204 fs.closeSync(stream.nfd);
205 }
206 },
207 llseek(stream, offset, whence) {
208 var position = offset;
209 if (whence === {{{ cDefs.SEEK_CUR }}}) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected