3 ms·
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 tha
by technion 2y ago
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.
- Munksgaard 2y agoThere isn't actually any close() function in the std::fs::File: https://doc.rust-lang.org/std/fs/struct.File.html https://doc.rust-lang.org/std/fs/struct.File.html
- ibotty 2y agoAnd if there were one (`drop` kind-of is that function though), it will consume the file handle so you cannot call it again.