Expand description
Path-related utilities.
Functions§
- absolute
- Return the absolute and normalized path without accessing the filesystem.
- atomic_
write_ symlink - Pick a random file name
path.$RAND.atomicasreal_path. Writedatato it. Then modify the symlinkpathto point toreal_path. Attempt to delete files that are no longer referred. - create_
dir - Create the directory and ignore failures when a directory of the same name already exists.
- create_
dir_ all_ with_ mode - Create the directory and its ancestors. The mode argument is ignored on non-UNIX systems.
- create_
shared_ dir - Create the directory with group write permission on UNIX systems.
- create_
shared_ dir_ all - Create the directory and ancestors with group write permission on UNIX systems.
- expand_
path - Expand the user’s home directory and any environment variables references in the given path.
- normalize
- Normalize path to collapse “..”, “.”, and duplicate separators. This function does not access the filesystem, so it can return an incorrect result if the path contains symlinks.
- relativize
- Return a relative
PathBufto the path from the base path. - remove_
file - Remove the file pointed by
path. - root_
relative_ path - Given cwd, return
pathrelative toroot, or None ifpathis not underroot. This is analagous to pathutil.canonpath() in Python. - strip_
unc_ prefix - Removes the UNC prefix
\\?\on Windows. Does nothing on unices. - symlink_
dir - Create symlink for a dir.
- symlink_
file - Create symlink for a file.