![]() |
Chilkat HOME Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi DLL Go Java JavaScript Node.js Objective-C PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(Tcl) Find a ZIP Entry by EntryID Using EntryByIdSee more Zip Examples This example demonstrates how to use the Each This is useful when:
The example:
Note: This example requires Chilkat v11.0.0 or greater.
load ./chilkat.dll set success 0 set success 0 # Open an existing ZIP archive. set zip [new_CkZip] set success [CkZip_OpenZip $zip "example.zip"] if {$success == 0} then { puts [CkZip_lastErrorText $zip] delete_CkZip $zip exit } # Retrieve the first entry in the ZIP archive. set entry [new_CkZipEntry] set success [CkZip_EntryAt $zip 0 $entry] if {$success == 0} then { puts [CkZip_lastErrorText $zip] delete_CkZip $zip delete_CkZipEntry $entry exit } puts "Original entry:" puts " FileName: [CkZipEntry_fileName $entry]" puts " EntryID: [CkZipEntry_get_EntryID $entry]" puts # Save the EntryID for later use. set entryId [CkZipEntry_get_EntryID $entry] # Create another ZipEntry object. set entry2 [new_CkZipEntry] # Retrieve the same entry using EntryById. set success [CkZip_EntryById $zip $entryId $entry2] if {$success == 0} then { puts [CkZip_lastErrorText $zip] delete_CkZip $zip delete_CkZipEntry $entry delete_CkZipEntry $entry2 exit } puts "Entry retrieved by EntryID:" puts " FileName: [CkZipEntry_fileName $entry2]" puts " EntryID: [CkZipEntry_get_EntryID $entry2]" puts # The filenames and EntryID values should match. CkZip_CloseZip $zip puts "Done." delete_CkZip $zip delete_CkZipEntry $entry delete_CkZipEntry $entry2 |
||||
© 2000-2026 Chilkat Software, Inc. All Rights Reserved.