What are some options for zipping and unzipping files within a Clarion app?
I don’t remember what I used for that back in the day and a Google search isn’t helpful.
What are some options for zipping and unzipping files within a Clarion app?
I don’t remember what I used for that back in the day and a Google search isn’t helpful.
I think there’s some sort of compression built in somewhere in the RTL
I might have to do some searching.
Lszip from lindersoft
Lszip from lindersoft
Ah, that was it. I was able to locate it in my archives and I’m in business.
Thank you.
You can Zip / UnZip in a BAT file calling PowerShell version 5 which is in Windows 10. No need to install 7Zip or anything. Handy for some quick simple work.
REM Compress Folder %BakFolder% into %BakZip%
powershell Compress-Archive -Path %BakFolder%\* -DestinationPath %BakZip%
https://ss64.com/ps/compress-archive.html
Thanks Carl. I did dig up my old LSZip license – and even some of my old code from 2008 – and I have zipping/unzipping working now.
You can work with ZIP archives from the Windows shell.
CreateZIPFile PROCEDURE (String Source_,String ZipFile_,Byte NoMess_)
Loc:Object CSTRING(65)
Loc:RetValue BYTE(False)
CODE
If SaveFile(ZipFile_,'<80><75><5><6>' & All(Chr(0),18)) ! Create empty ZIP File
Loc:Object = Create(0,Create:Ole)
Loc:Object{Prop:Create} = 'Shell.Application'
If ~NoMess_ then Loc:Object{Prop:ReportException} = True. ! Display message
Loc:Object{'NameSpace("' & Clip(ZipFile_) & '").CopyHere("' & Clip(Source_) & '",20)'}
Loop until Loc:Object{'NameSpace("' & Clip(Left(ZipFile_)) & '").Items().Count'} = 1
Loop 100 times
Yield
end
end
If Exists(ZipFile_) then Loc:RetValue = True.
Loc:Object{Prop:Deactivate}
end
Return Loc:RetValue
You can work with ZIP archives from the Windows shell.
Thank you. I already have LSZip working with my app, but I’ll note your suggestion for the future.
Just for your information: there is a public domain zip class (it is a wrapper for zlib).
Just for your information: there is a public domain zip class (it is a wrapper for zlib).
It would be good to link to that class here in case someone else searches.
here is a link to the class and an example:
If anybody have a question, just ask. regards
ClarionZipClass.zip (109.8 KB)
Thank you! I’ll have a look.
Thanks, I saved it for future. Currently I’m still using Jzip, which uses 7zip and works ok.
Here’s an update to my scenario:
I think John was going to do a ClarionLive about the code. Hopefully he shares his updated code.
(I mistakenly posted this update at Create a ZIP file from a Clarion Application - #3 by sjreryan. Posting it here as well so that this thread is complete.)
You can also take a look at JZip:
https://strategyonline.net/docs/clarion/jzip.htm
I know Gary has made almost all his utilities free many years ago.
Interesting. I didn’t know that. Are they available to download somewhere? I tried the download on the link you posted and they are dead. Is anyone updating those products or are they just set in time?
And whatever happened to Gary? He was so prolific back in the day.
I know at some stage there was a list where you could download all the free tools on Gary’s site.
I think he also had the installation passwords listed on his site.
I can’t find it now.
I don’t think anybody has taken Gary’s tools over.
Apparently Gary is still around somewhere.
I tried to contact Gary numerous times with no luck.
That’s too bad, but times change and people move on to new things.
Do you happen to have JZip to share? I wouldn’t mind having a look at it’s unzipping capabilities.
Hello,
Do you have an example to unzip the file using the CZipClass?
Thank you.
Do you have instructions on how to implement this properly? I put the files where I thought they should go then used the example code to try it myself. I got my code to compile, but when I run it I get a GPF when it gets to my data section where I try to instantiate the zip with:
MyCZip CZipClass