Module fs

Module fs 

Source
Expand description

Filesystem operations with feature-gated error handling

Structs§

Metadata
Metadata information about a file.
ReadDir
Iterator over the entries in a directory.

Functions§

create_dir
Creates a new, empty directory at the provided path
create_dir_all
Recursively create a directory and all of its parent components if they are missing.
create_file
Create an empty file if it doesn’t already exist
metadata
Given a path, queries the file system to get information about a file, directory, etc.
read
Reads the entire contents of a file into a bytes vector.
read_dir
Returns an iterator over the entries within a directory.
read_to_string
Reads the entire contents of a file into a string.
remove_dir
Removes an empty directory.
remove_dir_all
Removes a directory at this path, after removing all its contents. Use carefully!
remove_file
Removes a file from the filesystem.
rename
Renames a file or directory to a new name, replacing the original file if to already exists.
set_permissions
Changes the permissions found on a file or a directory.
write
Writes a slice as the entire contents of a file.