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
topath_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