Structs§
- CdGuard
- A struct that changes the current working directory to a specified path.
Functions§
- cd
- Change the current working directory.
- copy_
file - Copies a file from one location to another.
- create_
folder - Creates a new folder at the specified path if it does not already exist.
- create_
folder_ for_ file - Creates the parent folder for a file at the specified path if it does not already exist.
- delete_
file - Deletes a file at the specified path if it exists.
- delete_
folder - Deletes a folder at the specified path if it exists.
- get_cwd
- Get the current working directory.
- get_
file_ extension - Get the file extension.
- get_
file_ name - Get the file name (including any extension).
- get_
file_ stem - Get the file stem (i.e. file name without its extension).
- get_
home - Retrieves the user’s home directory from the
$HOME
environment variable. - get_
last_ path_ component - Get the last component of a path (file or folder name).
- load_
file_ as_ string - Loads the content of a file as a string.
- replace_
str_ in_ file - Replaces all occurrences of a string in a file.
- replace_
str_ in_ files - Replaces all occurrences of a string in all files within a directory (including subdirectories).
- save_
string_ to_ file - Saves a string to a file at the specified path.
- to_
path_ buf - Converts a path to a
PathBuf
.