GeoEco.DataManagement.Files.File.IsDecompressible

classmethod File.IsDecompressible(compressedFile)

Returns True if the specified file is in a format that can be decompressed.

This method examines the extension of the specified file to see if it indicates the file is compressed in a format that is supported by the decompression functions.

This method does not actually open the file, or even check its existence. Thus, even if this method returns True, it does not guarantee decompression will succeed if attempted.

Parameters:

compressedFile (str) –

File to evaluate.

The compression formats presently supported are:

  • .bz2 - a single file compressed in bzip2 format

  • .gz - a single file compressed in gzip format

  • .tar - one or more files archived in UNIX tar format

  • .zip - one or more files archived and compressed in ZIP format

  • .Z - a single file compressed in UNIX “compress” format

tar files that are compressed in bzip2 (.tar.bz2), gzip (.tar.gz) or compress format (.tar.Z) are automatically handled.

Minimum length꞉ 1.

Returns:

True if the specified file is in a format that can be decompressed.

Return type:

bool