You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After opening a file with Deno.open one receives a Deno.FsFile type that has both .readable and .writable properties. The ambiguity is that these properties don't mention if one is still required to call .close() when using these properties.
With this code, it is ambiguous on if I need to add a way to know when .readable is exhausted to call the .close() or if it will cause a memory leak with the file hanging around until the program dies.
Some people on the Deno team has said that it does close itself once the .readable is exhausted, but others have also not been so sure.
I am sure it is actually closing itself once exhausted but the ambiguity exists as the doc examples are also making use of the using keyword which promises to clean itself up at the end of the scope, but using the using keyword in the above example would cause an error to throw.
The text was updated successfully, but these errors were encountered:
After opening a file with
Deno.open
one receives aDeno.FsFile
type that has both.readable
and.writable
properties. The ambiguity is that these properties don't mention if one is still required to call.close()
when using these properties.For example:
With this code, it is ambiguous on if I need to add a way to know when
.readable
is exhausted to call the.close()
or if it will cause a memory leak with the file hanging around until the program dies.Some people on the Deno team has said that it does close itself once the
.readable
is exhausted, but others have also not been so sure.I am sure it is actually closing itself once exhausted but the ambiguity exists as the doc examples are also making use of the
using
keyword which promises to clean itself up at the end of the scope, but using theusing
keyword in the above example would cause an error to throw.The text was updated successfully, but these errors were encountered: