Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Best zipping solution (activeX or else)
Message
From
05/10/2015 09:06:43
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01625178
Message ID:
01625464
Views:
95
This message has been marked as a message which has helped to the initial question of the thread.
>Sure if you can find a COM component that's great, but you should rethink shying away from Command line shelling. In many cases it's the simplest and quickest solution to a problem. Especially if you use CreateProcess() to hide windows and potentially capture output.

Exactly what I'm doing - I use the original Pkzip25.exe by Phil Katz, the last freebie DOS version, and it still works on every one of the Windowses that came around. To shell out, I use late Ed Rauh's api_apprun library (actually one single class, can be found in downloads here)...
		lcZipName=THIS.zipname
		listfile=FULLPATH(".\zip.lst")
		STRTOFILE(THIS.FILES, listfile)
		lcbatFile=FULLPATH(FORCEEXT(SYS(2015),"bat"))
		logfile=FORCEEXT(lcbatFile,"log")
		THIS.logfile=logfile
		lcPKZ=FULLPATH("pkzip25.exe")

		TEXT textmerge noshow to lcBat
"<<lcPkz>>" -add=update -dire "<<lcZipName>>"  @"<<listfile>>" >"<<logfile>>"
		ENDTEXT
		lcThere=FULLPATH(".")
		STRTOFILE(lcBat, lcbatFile)
		LOCAL oprocess AS api_apprun OF PROCESS.vcx
		oprocess=NEWOBJECT('api_apprun','process', '', lcbatFile, lcThere, 'HID')
		oprocess.LaunchAppAndWait()
		RELEASE oprocess
		ERASE (lcbatFile)
And it's still blazingly fast. This.files is a list of files to zip, but it can just contain a (full path to a) single file. In some cases I also parse the log file, to check for errors.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform