General question: I need to work with files in a compressed (zip) folder (reading and writing). I've found a few somewhat convoluted examples in other languages (some time ago now) but porting them to FB looked to be a task most daunting - ergo I gave up :(
I'm going to give it another go so any ideas or even a starting point would be helpful :)
You can call 7-zip from a command line, so you could generate the commands you need in fb, and then 'run' the command. Not sure if that is what you want to do
Thanks, Ray, I'll look into 7-Zip. I was hoping to find a FB/Win API solution.
I had an application years ago that I needed zip support. I ended up going the same path as Ray and simply shelled the calls to 7-zip. It worked well and the application continues to function perfectly all these years later.
I'm looking into it, thanks, Paul.
Shell "7z.exe a myzipfile.zip -pMyPassword -mx9 -aoa -r *.xls", 0
' -r recurse to subfolders
' -p password protect
' -mx9 compression level 9
' -aoa overwrite existing files without prompt
This was used with 7-zip version 9.20 from 2010 so who knows if it works now. It simply creates a password protected archive containing, in my case, *.xls spreadsheet files in the folder. Obviously I have changed the archive name and password in the above example. :-)
Thanks, Ray & Paul. Using Paul's example with 7z 19.00 (x64) worked great - and screaming fast. I tested with a batch file using the -u switch on 487 files and all the console did was flash. However, the newly created zip folder contained the correct files. I'll add a PAUSE or TIMEOUT x to the batch file and use the Shell command for FB (in my batch files I use the >> to append XCOPY output to an existing log file).
Not sure if this is what you are looking for, but there is also a set of (de)compress functions in the Win32 API. See https://docs.microsoft.com/en-us/windows/win32/cmpapi/-compression-portal (https://docs.microsoft.com/en-us/windows/win32/cmpapi/-compression-portal). Good luck, Wilko
Thanks, Wilko, I'll definitely check it out.