Filesystem utilities 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.  |  
  temp_file ¶
  A context manager that creates a temporary file and yields a path to it. Example:
Yields:
| Type | Description | 
|---|---|
 Path  |    The resolved path to the temporary file, 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.  |  
  write_atomic ¶
  Atomically write data to the current path. This is equivalent to the following:
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
 data  |   str | bytes  |    The data to write.  |  required | 
Other Parameters:
| Name | Type | Description | 
|---|---|---|
*args |   Any  |    Additional arguments to pass to   |  
**kwargs |   Any  |    Additional keyword arguments to pass to   |