3//! This module contains basic methods to manipulate the contents of the local
4//! filesystem. All methods in this module represent cross-platform filesystem
5▶//! operations. Extra platform-specific functionality can be found in the
6//! extension traits of `std::os::$platform`.
7//!
· · ·
71/// use std::io::prelude::*;
72///
73▶/// fn main() -> std::io::Result<()> {
74/// let mut file = File::create("foo.txt")?;
75/// file.write_all(b"Hello, world!")?;
· · ·
84/// use std::io::prelude::*;
85///
86▶/// fn main() -> std::io::Result<()> {
87/// let mut file = File::open("foo.txt")?;
88/// let mut contents = String::new();
· · ·
100/// use std::io::prelude::*;
101///
102▶/// fn main() -> std::io::Result<()> {
103/// let file = File::open("foo.txt")?;
104/// let mut buf_reader = BufReader::new(file);
· · ·
159/// # Platform-specific behavior
160///
161▶/// On supported systems (including Windows and some UNIX-based OSes), this function acquires a
162/// handle/file descriptor for the directory. This allows functions like [`Dir::open_file`] to
163/// avoid [TOCTOU] errors when the directory itself is being moved.
+ 215 more matches in this file