![]() |
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
(PowerBuilder) Find a ZIP Entry by Exact Path Using EntryOfSee more Zip Examples This example demonstrates how to use the Unlike This method is useful when:
Suppose the ZIP archive contains: ZIP archives may optionally contain explicit directory entries such as The example:
Note: This example requires Chilkat v11.0.0 or greater.
integer li_rc integer li_Success oleobject loo_Zip oleobject loo_Entry li_Success = 0 // This example assumes the Chilkat API to have been previously unlocked. // See Global Unlock Sample for sample code. li_Success = 0 // Open an existing ZIP archive. loo_Zip = create oleobject li_rc = loo_Zip.ConnectToNewObject("Chilkat.Zip") if li_rc < 0 then destroy loo_Zip MessageBox("Error","Connecting to COM object failed") return end if li_Success = loo_Zip.OpenZip("example.zip") if li_Success = 0 then Write-Debug loo_Zip.LastErrorText destroy loo_Zip return end if loo_Entry = create oleobject li_rc = loo_Entry.ConnectToNewObject("Chilkat.ZipEntry") // ------------------------------------------------------------ // Find a specific file entry by its exact ZIP path. li_Success = loo_Zip.EntryOf("docs/readme.txt",loo_Entry) if li_Success = 1 then Write-Debug "Found file entry:" Write-Debug " FileName = " + loo_Entry.FileName Write-Debug " IsDirectory = " + string(loo_Entry.IsDirectory) Write-Debug "" end if // ------------------------------------------------------------ // Find a directory entry. // // ZIP archives may optionally contain explicit directory entries. // In this example, "docs/" is a separate directory entry. li_Success = loo_Zip.EntryOf("docs/",loo_Entry) if li_Success = 1 then Write-Debug "Found directory entry:" Write-Debug " FileName = " + loo_Entry.FileName Write-Debug " IsDirectory = " + string(loo_Entry.IsDirectory) Write-Debug "" end if // ------------------------------------------------------------ // Attempt to find a non-existent entry. li_Success = loo_Zip.EntryOf("images/missing.png",loo_Entry) if li_Success = 0 then Write-Debug "The entry images/missing.png was not found." end if loo_Zip.CloseZip() Write-Debug "Done." destroy loo_Zip destroy loo_Entry |
||||
© 2000-2026 Chilkat Software, Inc. All Rights Reserved.