compression.gunzip(file)

The gunzip() function decompress a GZIP compressed file.

Parameters

file

A string or a File instance, representing the GZIP compressed file.

Return value

Returns a temporary File instance that represent the decompressed file.

Example

local compression = require "compression" if #arg == 0 then error("error: no input file") end -- open the gzip compressed file and decompress it local file = sys.File(arg[1]) local gunzipped_file = compression.gunzip(file) -- output the size of the original and decompressed file print("GZipped file : "..file.size) print("Decompressed File size : "..gunzipped_file.size) gunzipped_file:remove()