Utils¶
blipss.utils.general_utils
¶
General filesystem utility functions
check_file_exists(filepath)
¶
Return True if the given path points to an existing file, False otherwise.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filepath
|
Path
|
Filesystem path to check |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if |
Source code in blipss/utils/general_utils.py
25 26 27 28 29 30 31 32 33 34 35 | |
ensure_path_exists(path)
¶
Create a directory at the given path, handling file and missing-parent cases.
If the path already exists as a directory, returns immediately. If the path points to an existing file, creates the file's parent directory tree instead. Otherwise creates the directory along with any missing intermediate parents.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Path
|
Filesystem path at which to create the directory |
required |
Source code in blipss/utils/general_utils.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | |