gzContentsInfo

function to get header and trailer info from GZip files
32 Downloads
Updated 18 Apr 2016

View License

function to get header and trailer info from GZip files
[gz, br] = gzContentsInfo( gzFilePath )
e.g. [gz, br] = gzContentsInfo( 'D:\myfile.ext.gz' );
INPUT:
gzFilePath - name or path as char or cellstr of GZip file(s),
supports wildcards, e.g.
'D:\arc.ext.gz'
'D:\*.gz'
{'D:\arc1.ext.gz' 'D:\arc2.ext.gz'}

OUTPUT:
gz - structured variable modeled after MATLAB's dir(...) with extra
fields related to the GZip file, e.g. gz...
.name = original name of the file*
.date = date string based on MTIME*
.bytes = ISZIE in bytes
.datenum = MATLAB's datenum based on MTIME's format
.ValidID = logical on GZip's header validation
.Compression = string of method (CM) and mode (XFL), e.g. deflate-4
.isText = logical if uncompressed data is likely plaintext
.OS = string of OS declared during compression
.Comment = if declared, plain text comment
.CRC32 = hex string of CRC32 of uncompressed data
* if info NOT explicit, it is inferred from gzFilePath

br - raw (b)inary (r)eads of GZip file and intermediate calculations

(C) Jake D.L. August, 2016/Apr/17
august(dot)jdbl(at)outlook(dot)com

Cite As

Jake August (2024). gzContentsInfo (https://www.mathworks.com/matlabcentral/fileexchange/56620-gzcontentsinfo), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2014b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on File Compression in Help Center and MATLAB Answers
Tags Add Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.0.0.0

Adding better description for File.