File Exchange

image thumbnail

LISTZIPCONTENTS

version 1.0.0.0 (1.6 KB) by Bob Hamans
Lists the contents of a zip file.

5 Downloads

Updated 06 Jul 2011

View License

LISTZIPCONTENTS(ZIPFILENAME) lists the archived contents of ZIPFILENAME

ZIPFILENAME is a string specifying the name of the zip file.

ZIPFILENAME can include the directory name; otherwise, the file must be
in the current directory or in a directory on the MATLAB path.

FILENAMES = LISTZIPCONTENTS(ZIPFILENAME) lists the zip file contents
and returns the file names into the string cell array FILENAMES.

Unsupported zip files
---------------------
LISTZIPCONTENTS does not support password-protected or encrypted zip
archives.

Examples
--------
% List the contents of demos.zip
listzipcontents('demos.zip')

Cite As

Bob Hamans (2019). LISTZIPCONTENTS (https://www.mathworks.com/matlabcentral/fileexchange/32089-listzipcontents), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (6)

Dear all,
I am processing the global positioning system-total electron content data, it is in the form of 00_grid_asc.gz. this file has 120 ASCII files. I used this code but I am unable to read them. I mean, I could not see the 120 files. Please someone can help me?

This is a great script. It inspired me to write another to get not only the file names, but all available get* methods, e.g. [uncompressed] size, CRC, time.

Angel

Function works nicely. However, zip file remains open until matlab is closed. To avoid this problem it is requieed to add at the end of the file : zipFile.close

Once this is added the file is perfect.

Very useful!

Oleg Komarov

Instead of:

zipFile = org.apache.tools.zip.ZipFile(zipJavaFile);
% Extract the entries from the ZipFile.
entries = zipFile.getEntries;

I use the following to circumvent a bug in org.apache.tools.zip.*:

zipFile = java.util.zip.ZipFile(zipJavaFile);
% Extract the entries from the ZipFile.
entries = zipFile.entries;

Oleg Komarov

Tested on R2014a and lists contents without unzipping.

Couldn't be simpler.

MATLAB Release Compatibility
Created with R2008a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags
Acknowledgements

Inspired: zipContentsInfo