Module path

Source
Available on crate feature kernel only.
Expand description

File path utilities.

Some of the functions are similar to std::path::Path ones, but here they work directly upon &str instead of &OsStr.

Functionsยง

dir_list
Returns an iterator over the files and folders within a directory. Optionally, a wildcard can be specified to filter files by name.
dir_walk
Returns an interator over the files within a directory, and all its subdirectories, recursively.
exe_pathDebug-assertions enabled
Returns a new string with the path of the current EXE file, without the EXE filename, and without a trailing backslash.
exists
Returns true if the path exists.
get_file_name
Extracts the file name from a full path, if any.
get_path
Extracts the full path, but the last part.
has_extension
Tells whether the full path ends in one of the given extensions, case-insensitive.
is_directory
Returns true if the path is a directory. Calls GetFileAttributes.
is_hidden
Returns true if the path is hidden. Calls GetFileAttributes.
replace_extension
Replaces the file extension by the given one, returning a new string.
replace_file_name
Replaces the file name by the given one, returning a new string.
replace_path
Keeps the file name and replaces the path by the given one, returning a new string.
rtrim_backslash
Removes a trailing backslash, if any.
split_parts
Returns a Vec with each part of the full path.