Title: File descriptor 0 might not get closed when used in file stream · Issue #57905 · nodejs/node · GitHub
Open Graph Title: File descriptor 0 might not get closed when used in file stream · Issue #57905 · nodejs/node
X Title: File descriptor 0 might not get closed when used in file stream · Issue #57905 · nodejs/node
Description: Just from reading the code it seems the file descriptor 0 is not closed for streams. node/lib/internal/fs/streams.js Lines 117 to 127 in e61937b function close(stream, err, cb) { if (!stream.fd) { cb(err); } else if (stream.flush) { stre...
Open Graph Description: Just from reading the code it seems the file descriptor 0 is not closed for streams. node/lib/internal/fs/streams.js Lines 117 to 127 in e61937b function close(stream, err, cb) { if (!stream.fd) { ...
X Description: Just from reading the code it seems the file descriptor 0 is not closed for streams. node/lib/internal/fs/streams.js Lines 117 to 127 in e61937b function close(stream, err, cb) { if (!stream.fd) { ...
Opengraph URL: https://github.com/nodejs/node/issues/57905
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"File descriptor 0 might not get closed when used in file stream","articleBody":"Just from reading the code it seems the file descriptor `0` is not closed for streams.\n\nhttps://github.com/nodejs/node/blob/e61937b82cbaec758cceeb08876dd51f976b23c2/lib/internal/fs/streams.js#L117-L127\n\nI have not run any tests to confirm that, but the check in code `if (!stream.fd)` looks rather clear and does not work for fd `0`. The `_close` function actually sets `null`, so more null-like check should be there:\n\nhttps://github.com/nodejs/node/blob/e61937b82cbaec758cceeb08876dd51f976b23c2/lib/internal/fs/streams.js#L129-L134\n","author":{"url":"https://github.com/oldium","@type":"Person","name":"oldium"},"datePublished":"2025-04-16T22:46:44Z","url":"https://github.com/nodejs/node/issues/57905"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:bf1934cd-9c50-4124-aedd-ce228ae87764 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C266:3CE69D:45864B:5A13F2:6AED246F |
| html-safe-nonce | dd48a340b704a4125acb731ce8ba100092972e427ea16d0c99915a1f55030d44 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMjY2OjNDRTY5RDo0NTg2NEI6NUExM0YyOjZBRUQyNDZGIiwidmlzaXRvcl9pZCI6IjE3NjYwMDY3NTQ4MDIyMTM5OTkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 806f2ba3c89d90c1c2d8d3e9868e9ddc788d949e8846548c8271c35ddf0fef01 |
| hovercard-subject-tag | issue:3000918528 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/57905/issue_layout |
| twitter:image | https://opengraph.githubassets.com/31af0be7fc618aaa9caf22e1d605b8e42b9dd0421589de59bf4b73d0d24d2676/nodejs/node/issues/57905 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/31af0be7fc618aaa9caf22e1d605b8e42b9dd0421589de59bf4b73d0d24d2676/nodejs/node/issues/57905 |
| og:image:alt | Just from reading the code it seems the file descriptor 0 is not closed for streams. node/lib/internal/fs/streams.js Lines 117 to 127 in e61937b function close(stream, err, cb) { if (!stream.fd) { ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | oldium |
| hostname | github.com |
| expected-hostname | github.com |
| None | e3e0f7f63e50c6fe879198a93a0a023a648ecc0a5e9bc3b5e033ac57172237e6 |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 707a24b346ac8a82878b9c084efaa38a997660cb |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width