Module cargo_util::paths [−][src]
Expand description
Various utilities for working with files and paths.
Structs
PathAncestors |
Functions
ancestors | Returns an iterator that walks up the directory hierarchy towards the root. |
append | Equivalent to [ |
bytes2path | Converts UTF-8 bytes to a path. |
copy | Copies a file from one location to another. |
create | Creates a new file. |
create_dir_all | Equivalent to |
create_dir_all_excluded_from_backups_atomic | Creates an excluded from cache directory atomically with its parents as needed. |
dylib_path | Returns a list of directories that are searched for dynamic libraries. |
dylib_path_envvar | Returns the name of the environment variable used for searching for dynamic libraries. |
join_paths | Joins paths into a string suitable for the |
link_or_copy | Hardlink (file) or symlink (dir) src to dst if possible, otherwise copy it. |
mtime | Returns the last modification time of a file. |
mtime_recursive | Returns the maximum mtime of the given path, recursing into subdirectories, and following symlinks. |
normalize_path | Normalize a path, removing things like |
open | Opens an existing file. |
path2bytes | Converts a path to UTF-8 bytes. |
read | Reads a file to a string. |
read_bytes | Reads a file into a bytes vector. |
remove_dir | Equivalent to |
remove_dir_all | Recursively remove all files and directories at the given directory. |
remove_file | Equivalent to |
resolve_executable | Returns the absolute path of where the given executable is located based
on searching the |
set_file_time_no_err | Changes the filesystem mtime (and atime if possible) for the given file. |
set_invocation_time | Record the current time on the filesystem (using the filesystem’s clock) using a file at the given directory. Returns the current time. |
strip_prefix_canonical | Strips |
write | Writes a file to disk. |
write_if_changed | Equivalent to [ |