pysys.utils.fileunzip¶
Unpacking one or more compressed files.
Deprecated - use pysys.basetest.BaseTest.unpackArchive
instead.
unzipall¶
-
pysys.utils.fileunzip.
unzipall
(path, binary=False)[source]¶ Unzip all .gz files in a given directory.
Archive files are automatically deleted after unzipping.
- Parameters
path – The full path to the directory containing the archive files.
binary – Boolean flag to indicate if the unzipped files should be written as binary. The default value of False indicates that on some platforms newline characters will be converted to the operating system default.
- Raises
FileNotFoundException – Raised if the directory path does not exist.
unzip¶
-
pysys.utils.fileunzip.
unzip
(zfilename, replace=False, binary=False)[source]¶ Unzip a .gz archive and write the contents to disk.
Deprecated - replace
unzip(gzfilename, binary=True)
withself.unpackArchive(gzfilename, gzfilename[:-3])
The method will unpack a file of the form
file.data.gz
tofile.data
, removing the archive file in the process if thereplace
input parameter is set to true.By default the unpacked archive is treated as non-binary data, unless the binary input parameter is set to true.
- Parameters
zfilename – The full path to the archive file.
replace – Boolean flag to indicate if the archive file should be removed after unpacking.
binary – Boolean flag to indicate if the unzipped file should be written as binary. The default value of False indicates that on some platforms newline characters will be converted to the operating system default.
- Raises
pysys.exceptions.FileNotFoundException – Raised if the archive file does not exist.
pysys.exceptions.IncorrectFileTypeEception – Raised if the archive file does not have a .gz extension.