Expand description
Upstream: https://github.com/rust-lang/cargo/blob/rust-1.83.0/crates/cargo-util/src/paths.rs Various utilities for working with files and paths.
Structs§
- An iterator that walks up the directory hierarchy towards the root.
Functions§
- Returns an iterator that walks up the directory hierarchy towards the root.
- Equivalent to
write()
, but appends to the end instead of replacing the contents. - Converts UTF-8 bytes to a path.
- Copies a file from one location to another.
- Creates a new file.
- Equivalent to
std::fs::create_dir_all
with better error messages. - Creates an excluded from cache directory atomically with its parents as needed.
- Returns a list of directories that are searched for dynamic libraries.
- Returns the name of the environment variable used for searching for dynamic libraries.
- Mark an existing directory as excluded from backups and indexing.
- Joins paths into a string suitable for the
PATH
environment variable. - Hardlink (file) or symlink (dir) src to dst if possible, otherwise copy it.
- Returns metadata for a file (follows symlinks).
- Normalize a path, removing things like
.
and..
. - Opens an existing file.
- Converts a path to UTF-8 bytes.
- Reads a file to a string.
- Reads a file into a bytes vector.
- Equivalent to
std::fs::remove_dir
with better error messages. - Equivalent to
std::fs::remove_dir_all
with better error messages. - Equivalent to
std::fs::remove_file
with better error messages. - Returns the absolute path of where the given executable is located based on searching the
PATH
environment variable. - Strips
base
frompath
. - Returns metadata for a file without following symlinks.
- Creates a temporary directory in the given path and calls the given function.
- Writes a file to disk.
- Writes a file to disk atomically.
- Equivalent to
write()
, but does not write anything if the file contents are identical to the given contents.