tarfile_interface#
- ioapps.tarfile_interface.read_tarfile(path, tarball_path, mode=None, filelist=None)[source]#
DESCRIPTION:
This function parses a specified tarball archive and extracts the specified files; if filelist is NoneType upon entry, all files within the archive will be extracted.
- Parameters:
- path: str
A Python string specifying the path beneath which the contents of the tarball are to be extracted to.
- tarball_path: str
A Python string specifying the path to the tarball to be read.
- Raises:
- TarFileInterfaceError:
raised if an exception is encountered while extracting files from the tarball file path specified upon entry.
raised if an execption is encountered while extracting a specified file from the tarball file path specified upon entry.
- Return type:
None
- ioapps.tarfile_interface.write_tarfile(path, tarball_path, filelist=None, filedict=None, ref_local=False, gzip=False, compresslevel=1)[source]#
DESCRIPTION:
This function creates a POSIX compliant tarball file and appends the files within the specified filelist to the respective tarball file.
- Parameters:
- path: str
A Python string specifying the path beneath which the files to be archived (see filelist) exist on the local host.
- tarball_path: str
A Python string specifying the path to the tarball, containing the contents of path, to be written.
- Raises:
- TarFileInterfaceError:
raised if an exception is encountered while validating the parameter values provided upon entry.
- Return type:
None