mirror of
https://github.com/zebrajr/node.git
synced 2025-12-06 12:20:27 +01:00
By default, the `readableWebStream` method of `FileHandle` returns a ReadableStream that, when finished, does not close the underlying FileHandle. This can lead to issues if the stream is consumed without having a reference to the FileHandle to close after use. This commit adds an `autoClose` option to the `readableWebStream` method, which, when set to `true`, will automatically close the FileHandle when the stream is finished or canceled. The test modified in this commit demonstrates one of the cases where this is necessary in that the stream is consumed by separate code than the FileHandle which was being left to close the underlying fd when it is garbage collected, which is a deprecated behavior. PR-URL: https://github.com/nodejs/node/pull/58548 Reviewed-By: LiviaMedeiros <livia@cirno.name> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> |
||
|---|---|---|
| .. | ||
| cp | ||
| read | ||
| dir.js | ||
| glob.js | ||
| promises.js | ||
| recursive_watch.js | ||
| rimraf.js | ||
| streams.js | ||
| sync_write_stream.js | ||
| utils.js | ||
| watchers.js | ||