betty.os module - Betty documentation

Hide navigation sidebar
Hide table of contents sidebar
Skip to content
Back to top
View this page
Toggle table of contents sidebar

# betty.os module

Provide OS interaction utilities.

async betty.os.link_or_copy(source_path: Path, destination_path: Path) → None

  Create a symlink to a source path, or copy it to its destination otherwise.

  For most purposes, Betty requires files to be accessible at certain paths, rather than that these paths provide unique files. Therefore, the fastest thing to do is create symlinks. In case that fails, such as when the source and destination are on different disks, copy the file instead.

  Parameters:

    - source_path (`pathlib._local.Path`)

    - destination_path (`pathlib._local.Path`)

  Return type:

    `None`