vcorelib.io.archive package#
Module contents#
A module for extracting and creating arbitrary archives.
- vcorelib.io.archive.extractall(src: Path | str | None, dst: Path | str | None = None, maxsplit: int = 1, **extract_kwargs) Tuple[bool, int] [source]#
Attempt to extract an arbitrary archive to a destination. Return whether or not this succeeded and how long it took.
- vcorelib.io.archive.is_within_directory(directory: Path | str | None, target: Path | str | None) bool [source]#
Determine if a target path is within the provided directory.
- vcorelib.io.archive.make_archive(src_dir: Path, ext_str: str = 'tar.gz', dst_dir: Path = None, **archive_kwargs) Tuple[Path | None, int] [source]#
Create an archive from a source directory, named after that directory, and optionally moved to a destination other than the parent directory for the source. The extension specifies the kind of archive to create.
Return the path to the created archive (if it was created) and how long it took to create.