Performing I/O on ```BorrowedFd``` or ```BorrowedHandle``` objects with ```ManuallyDrop<std::fs::File>```

194 · Users Rust Lang · Aug. 9, 2026, 9:54 p.m.
Summary
This post discusses the safety of performing I/O operations on `BorrowedFd` or `BorrowedHandle` objects in Rust by converting them to raw file descriptors, and whether this approach is safer than using the OS API directly. It raises concerns about resource management in Rust and the potential risks of using `ManuallyDrop` with file handles.