mango.io.compress

mango.io.compress(filePath, dest=None, method='application/x-bzip2', preserve=True)

Compress specified file.

Parameters:
  • filePath (str) – File to be compressed.
  • dest (str) – Name of compressed file If dest==None, file name is filePath + ext where ext is the extension related to the compression method.
  • method (str) – Compression method used (e.g. BZIP2, GZIP).
  • preserve (bool) – If False, original uncompressed file is deleted after compressed file is created.
Return type:

str

Returns:

Compressed file name.

Previous topic

mango.io.splitpath

Next topic

mango.io.compressDir

This Page