unzip(zfilename,
replace=False,
binary=False)
| source code
|
Unzip a .gz archive and write the contents to disk.
The method will unpack a file of the form file.data.gz to
file.data , removing the archive file in the process if the
replace input parameter is set to true. By default the unpacked archive
is written as text data, unless the binary input parameter is set to
true, in which case the unpacked file is written as binary.
- 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
- Raises:
FileNotFoundException - Raised if the archive file does not exist
IncorrectFileTypeEception - Raised if the archive file does not have a .gz extension
|