Chilkat
HOME
Android™
ASP
Visual Basic
VB.NET
C#
iOS (IPhone)
Objective-C
C++
C
MFC
Delphi
FoxPro
Java
Perl
PHP Extension
PHP ActiveX
Python
PowerShell
Ruby
SQL Server
VBScript
List Files in a .zipHow to list files within a .zip Downloads: MS Windows Visual C/C++ Libraries Linux/CentOS C/C++ Libraries MAC OS X C/C++ Libraries Solaris C/C++ Libraries C++ Builder Libraries FreeBSD C++ Libraries HP-UX C++ Libraries BlackBerry QNX C++ Libraries #include <C_CkZip.h> #include <C_CkZipEntry.h> void ChilkatSample(void) { HCkZip zip; BOOL success; long n; HCkZipEntry entry; long i; zip = CkZip_Create(); // Any string unlocks the component for the 1st 30-days. success = CkZip_UnlockComponent(zip,"30-day trial"); if (success != TRUE) { printf("Failed to unlock zip!\n"); return; } success = CkZip_OpenZip(zip,"a.zip"); if (success != TRUE) { printf("%s\n",CkZip_lastErrorText(zip)); return; } // Get the number of files and directories in the .zip n = CkZip_getNumEntries(zip); printf("%d\n",n); for (i = 0; i <= n - 1; i++) { entry = CkZip_GetEntryByIndex(zip,i); if (CkZipEntry_getIsDirectory(entry) == FALSE) { // (the filename may include a path) printf("%s\n",CkZipEntry_fileName(entry)); } CkZipEntry_Dispose(entry); } CkZip_Dispose(zip); } |
Need a specific example? Send a request to support@chilkatsoft.com
© 2000-2010 Chilkat Software, Inc. All Rights Reserved.