Zip capability

Blitz3D Forums/Blitz3D Programming/Zip capability

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

(Too right! I'm still using dos batch files for backing up projects, filtering out .bak's etc. If you need any dos batch file tutorials let me know, I've got a couple...)

Cracked it! - Or at least good enough.

Firstly, my old copy of Pkzip produced a zip file, but with all internal names as per 8.3 DOS convention.
Doh! Should have thought of that.

Then I tried to get Winzip to react to a command line - went on their site, needs a plugin.... nevermind.

Did a search and found 7-zip... free and takes command lines:
http://www.7-zip.org

So finally I can zip up a folder full of files from wothin Blitz:-
example()
End

;-------------------------------------------
Function example()
;-------------------------------------------
	zipexedir$ = "E:\Projects\R4D\files\TLA\sys"
	sourcedir$ = "E:\Projects\R4D\files\Projects\Example"
	destfile$ = "C:\Example.zip"
	ZipFolder(zipexedir$,sourcedir$,destfile$)
End Function

;-------------------------------------------
Function ZipFolder(zipexedir$,sourcedir$,destfile$)
;-------------------------------------------
	If Right$(zipexedir$,1)<>"" Then zipexedir$ = zipexedir$ + "" 
	If Right$(sourcedir$,1)<>"" Then sourcedir$ = sourcedir$ + "" 
	doscommand$ = zipexedir$ + "7z.exe a -r -tzip " + destfile$ + " " + sourcedir$
	ExecFile "command /c "+ doscommand$
End Function

Backy Rose, I still can't get rid of that damn dos box; neither '>null' nor '>nul' has any effect.

Thanks for everyone's help.