Crate fsutils

Source
Expand description

Utilities for common filesystem operations.

fsutils provides an API based on Bash commands and includes a number of utility functions to make interacting with the filesystem simpler and more ergonomic.

Functions§

cd
Change the current working directory
create_file
Creates a file and returns a boolean based on success or failure.
create_file_bytes
Creates a file from bytes and returns a boolean based on success or failure.
directory_is_empty
Checks if a directory is empty and returns a boolean based on success or failure.
ls
List directory contents
mkdir
Creates a directory recursively at passed path and returns a boolean based on success or failure.
mv
Moves a file from path_one to path_two and returns a boolean based on success or failure.
path_exists
Checks if a path exists and returns a boolean based on success or failure.
read_file
Reads data from a file and returns a String with the files’s contents
rm
Removes a file at passed path and returns a boolean based on success or failure.
rm_r
Removes a directory recursively and returns a boolean based on success or failure.
rmdir
Removes an empty directory and returns a boolean based on success or failure.
run_command
Execute an arbitrary system command
write_file
Reads data to a file and returns a bool on success
write_file_append
Appends data to a file and returns a bool on success