Modules§
- cachedir
- Vendored from cachedir 0.3.1 to replace
std::fswithfs_err. - link
- Utilities for linking a file or directory with various options and automated fallback (e.g., to copying) when link methods are unsupported.
- which
Structs§
- Portable
Path - A path that can be serialized and deserialized in a portable way by converting Windows-style
backslashes to forward slashes, and using a
.for an empty path. - Portable
Path Buf
Enums§
- Locked
File Error - Locked
File Mode - Whether to acquire a shared (read) lock or exclusive (write) lock.
Statics§
- CWD
- The current working directory.
Traits§
Functions§
- copy_
atomic_ sync - Copy
fromtotoatomically using a temporary file and atomic rename. - copy_
dir_ all - Recursively copy a directory and its contents.
- create_
symlink - Create a symlink at
dstpointing tosrc. - directories
- Iterate over the subdirectories of a directory.
- entries
- Iterate over the entries in a directory.
- files
- Iterate over the files in a directory.
- is_
same_ file_ allow_ missing - Attempt to check if the two paths refer to the same file.
- is_
temporary - Returns
trueif a path is a temporary file or directory. - is_
virtualenv_ base - Returns
trueif a path is the base path of a virtual environment, indicated by the presence of apyvenv.cfgfile. - is_
virtualenv_ executable - Checks if the grandparent directory of the given executable is the base of a virtual environment.
- normalize_
absolute_ path - Normalize a path, removing things like
.and... - normalize_
path - Normalize a
Cowpath, removing.,.., repeated separators (//), and trailing slashes. - normalize_
path_ under - Normalize
path, returning it when it remains strictly under a non-emptyroot. - normalize_
url_ path - Normalize the
pathcomponent of a URL for use as a file path. - persist_
with_ retry_ sync - Persist a
NamedTempFile, retrying (on Windows) if it fails due to transient operating system errors. - relative_
to - Compute a path describing
pathrelative tobase. - remove_
symlink - remove_
virtualenv - Perform a safe removal of a virtual environment.
- replace_
symlink - Create a symlink at
dstpointing tosrc, replacing any existing symlink if necessary. - symlink_
or_ copy_ file - Create a symlink at
dstpointing tosrcon Unix or copysrctodston Windows - tempfile_
in - Return a
NamedTempFilein the specified directory. - try_
relative_ to_ if - Try to compute a path relative to
baseifshould_relativizeis true, otherwise return the absolute path. Falls back to absolute if relativization fails. - verbatim_
path - Convert a
Pathto a Windowsverbatimpath (prefixed with\\?\) when possible to bypass Win32 path normalization such asMAX_PATHand removed trailing characters (dot, space). Other characters as defined byPath.GetInvalidFileNameCharsare still prohibited. This function will attempt to perform path normalization similar to Win32 default normalization without triggering the existing Win32 limitations. - with_
retry_ sync - Wrap an arbitrary operation on two files, e.g., copying, with retries on transient operating system errors.
- write_
atomic_ sync - Write
datatopathatomically using a temporary file and atomic rename.