* Closes the file descriptor. * @param {number} fd * @param {(err?: Error) => any} [callback] * @returns {void}
(fd, callback = defaultCloseCallback)
| 617 | * @returns {void} |
| 618 | */ |
| 619 | function close(fd, callback = defaultCloseCallback) { |
| 620 | if (callback !== defaultCloseCallback) |
| 621 | callback = makeCallback(callback); |
| 622 | |
| 623 | const h = vfsState.handlers; |
| 624 | if (h !== null && vfsVoid(h.close(fd), callback)) return; |
| 625 | |
| 626 | const req = new FSReqCallback(); |
| 627 | req.oncomplete = callback; |
| 628 | binding.close(fd, req); |
| 629 | } |
| 630 | |
| 631 | /** |
| 632 | * Synchronously closes the file descriptor. |
no test coverage detected
searching dependent graphs…