[][src]Module async_std::fs

Filesystem manipulation operations.

This module is an async version of std::fs.

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

DirBuilder

A builder for creating directories in various manners.

DirEntry

An entry inside a directory.

File

A reference to a file on the filesystem.

FileType

A structure representing a type of file with accessors for each file type. It is returned by Metadata::file_type method.

Metadata

Metadata information about a file.

OpenOptions

Options and flags which for configuring how a file is opened.

Permissions

Representation of the various permissions on a file.

ReadDir

A stream over entries in a directory.

Functions

canonicalize

Returns the canonical form of a path.

copy

Copies the contents and permissions of one file to another.

create_dir

Creates a new, empty directory.

hard_link

Creates a new hard link on the filesystem.

metadata

Queries the metadata for a path.

read

Read the entire contents of a file into a bytes vector.

read_dir

Returns a stream over the entries within a directory.

read_link

Reads a symbolic link, returning the path it points to.

read_to_string

Read the entire contents of a file into a string.

remove_dir

Removes an existing, empty directory.

remove_dir_all

Removes an directory and all of its contents.

remove_file

Removes a file from the filesystem.

rename

Renames a file or directory to a new name, replacing the original if it already exists.

set_permissions

Changes the permissions on a file or directory.

symlink_metadata

Queries the metadata for a path without following symlinks.

write

Writes a slice of bytes as the entire contents of a file.