Title: Make mkstemp disposable · Issue #67360 · nodejs/node · GitHub
Open Graph Title: Make mkstemp disposable · Issue #67360 · nodejs/node
X Title: Make mkstemp disposable · Issue #67360 · nodejs/node
Description: What is the problem this feature will solve? #66484 added mkstemp and mkstempSync, which return an object with path and handle methods. These require manual cleanup: The file is not removed automatically. It is the caller's responsibilit...
Open Graph Description: What is the problem this feature will solve? #66484 added mkstemp and mkstempSync, which return an object with path and handle methods. These require manual cleanup: The file is not removed automat...
X Description: What is the problem this feature will solve? #66484 added mkstemp and mkstempSync, which return an object with path and handle methods. These require manual cleanup: The file is not removed automat...
Opengraph URL: https://github.com/nodejs/node/issues/67360
X: @github
Domain: github.com
IPv4 address: 140.82.113.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Make mkstemp disposable","articleBody":"### What is the problem this feature will solve?\n\nhttps://github.com/nodejs/node/pull/66484 added mkstemp and mkstempSync, which return an object with `path` and `handle` methods. These require manual cleanup:\n\n> The file is not removed automatically. It is the caller's responsibility to close the {FileHandle} and to remove the file when it is no longer needed.\n\n### What is the feature you are proposing to solve the problem?\n\nThat object should have a Symbol.dispose method which removes the file when invoked.\n\nAs the PR says:\n\n> a disposable variant in the style of fs.mkdtempDisposableSync(). I would leave it for a follow-up, to keep this PR to the plain API.\n\nBut mkdtempDisposableSync needed to be a separate API, because it `mkdtempDisposable` returns a bare string. Here it's returning an object and so could be disposable directly, no need for a new API.\n\n### What alternatives have you considered?\n\n_No response_","author":{"url":"https://github.com/bakkot","@type":"Person","name":"bakkot"},"datePublished":"2026-11-09T14:55:34Z","url":"https://github.com/nodejs/node/issues/67360"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| 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:5d22034b-746b-6258-905f-bd9b3c25b7c1 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AF2C:103A59:1CAAD07:25DAA0E:6B033855 |
| html-safe-nonce | b6e354d50baebef0a1597c96438660215c732f562d7c810dacd45ddb068a4da6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRjJDOjEwM0E1OToxQ0FBRDA3OjI1REFBMEU6NkIwMzM4NTUiLCJ2aXNpdG9yX2lkIjoiNjg3NTc1ODY3Mjg5MTU1Nzk3MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 626dca7ce559aad04b659c3bc23b5de202bd20a9922125e8b2370586d0d8c3b5 |
| hovercard-subject-tag | issue:6288485905 |
| 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/67360/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ccb526c47feb5f8935e46baf23913043f28c9b6a7517fdd79c63809cdb71d32c/nodejs/node/issues/67360 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ccb526c47feb5f8935e46baf23913043f28c9b6a7517fdd79c63809cdb71d32c/nodejs/node/issues/67360 |
| og:image:alt | What is the problem this feature will solve? #66484 added mkstemp and mkstempSync, which return an object with path and handle methods. These require manual cleanup: The file is not removed automat... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | bakkot |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| 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 | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width