Expand description
Filesystem manipulation operations.
This module is an async version of std::fs
.
§Platform-specific extensions
- Unix: use the
os::unix::fs
module. - Windows: use the
os::windows::fs
module.
§Examples
Create a new file and write some bytes to it:
use async_std::fs::File;
use async_std::prelude::*;
let mut file = File::create("a.txt").await?;
file.write_all(b"Hello, world!").await?;
Structs§
- A builder for creating directories with configurable options.
- An entry in a directory.
- An open file on the filesystem.
- A structure representing a type of file with accessors for each file type. It is returned by
Metadata::file_type
method. - Metadata information about a file.
- A builder for opening files with configurable options.
- Representation of the various permissions on a file.
- A stream of entries in a directory.
Functions§
- Returns the canonical form of a path.
- Copies the contents and permissions of a file to a new location.
- Creates a new directory.
- Creates a new directory and all of its parents if they are missing.
- Creates a hard link on the filesystem.
- Reads metadata for a path.
- Reads the entire contents of a file as raw bytes.
- Returns a stream of entries in a directory.
- Reads a symbolic link and returns the path it points to.
- Reads the entire contents of a file as a string.
- Removes an empty directory.
- Removes a directory and all of its contents.
- Removes a file.
- Renames a file or directory to a new location.
- Changes the permissions of a file or directory.
- Reads metadata for a path without following symbolic links.
- Writes a slice of bytes as the new contents of a file.