Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional notes on releasing resources when using file streams #493

Merged
merged 9 commits into from
Oct 9, 2024
11 changes: 11 additions & 0 deletions deploy/api/runtime-fs.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,17 @@ async function handler(_req) {
Deno.serve(handler);
```

:::note

When you iterate over a file stream as shown below, the file descriptor
will be automatically closed at the end of iteration. There is no need to
manually close the file descriptor.


`const iterator = fd.readable[Symbol.asyncIterator]();`

:::
thisisjofrank marked this conversation as resolved.
Show resolved Hide resolved

thisisjofrank marked this conversation as resolved.
Show resolved Hide resolved
## Deno.File
thisisjofrank marked this conversation as resolved.
Show resolved Hide resolved

`Deno.File` is a file handle returned from [`Deno.open()`](#denoopen). It can be
Expand Down
Loading