(PowerBuilder) .Z File Compression
Use LZW compression to create a .Z compressed file. Compresses any single file into a .Z format compressed file.
(Chilkat's .Z compression functionality is included as part of the Chilkat Zip license.)
integer li_rc
oleobject loo_Uc
integer li_Success
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
loo_Uc = create oleobject
// Use "Chilkat_9_5_0.UnixCompress" for versions of Chilkat < 10.0.0
li_rc = loo_Uc.ConnectToNewObject("Chilkat.UnixCompress")
if li_rc < 0 then
destroy loo_Uc
MessageBox("Error","Connecting to COM object failed")
return
end if
li_Success = loo_Uc.CompressFile("hamlet.xml","hamlet.xml.Z")
if li_Success <> 1 then
Write-Debug loo_Uc.LastErrorText
else
Write-Debug "Success."
end if
destroy loo_Uc
|