Module fs

Source
Expand description

Fs access utilities

This is essentially a wrapper around standard fs, so it’s just to keep things similar.

Structs§

Metadata
Metadata information about a file.

Functions§

append
Append to a file given its path and data
canonicalize
Returns the canonical, absolute form of a path with all intermediate components normalized and symbolic links resolved.
create_dir
Creates a new, empty directory at the provided path
fstat
Get a path’s metadata
metadata
Given a path, queries the file system to get information about a file, directory, etc.
mkdir
Create a directory if it does not already exist
read
cat
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_all
Removes a directory at this path, after removing all its contents. Use carefully!
remove_file
Removes a file from the filesystem.
rm
rm for only files
rmdirr
rm -r for only directories
std_read
Reads the entire contents of a file into a bytes vector.
std_write
Writes a slice as the entire contents of a file.
touch
touch
write
Write to a file given its path and data

Type Aliases§

Result
A specialized Result type for I/O operations.