Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
technion
· 1y ago · 0 comments
The standard for rust is that close() gets called automatically when the file descriptor goes out of scope. I believe you could choose to do it manually but that's unusual coding.
Comments
[–]
Munksgaard
1y ago
There isn't actually any close() function in the std::fs::File:
https://doc.rust-lang.org/std/fs/struct.File.html
[–]
ibotty
1y ago
And if there were one (`drop` kind-of is that function though), it will consume the file handle so you cannot call it again.