Filesystem reference¶
temp_directory ¶
A context manager that creates a temporary directory and yields a path to it. Example:
Yields:
Type | Description |
---|---|
Path | The resolved path to the temporary directory, following all symlinks. |
Path ¶
Bases: Path
long_id ¶
long_id: str
Returns a SHA-256 hashed, URL-safe base64 encoded representation of the current path. This is useful on case-insensitive filesystems to identify paths that are the same.
Caveat
This identifier considers the filesystem to be case-insensitive on macOS. Although that is not a technical guarantee, it is in practice true.
Returns:
Type | Description |
---|---|
str | A unique identifier for the current path. |
ensure_dir ¶
Ensure the current path is a directory. Equivalent to calling Path.mkdir
with parents=True
and exist_ok=True
.
expand ¶
expand() -> Path
Expand the current path by resolving the user home directory and environment variables.
Returns:
Type | Description |
---|---|
Path | The new expanded path. |