Crate file_io

Source
Expand description

githubcrates-iodocs-rs

Easy interfaces for file i/o.

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.