Dr Gerard Hammond wrote:

HI,

Does anybody have a simple to use cross-platform zip class.

Something like

folderitem.(un)zip returns folderitem

I've tried Einhugur's, TT's and great-white's but am not happy with my results.

Gerard:

At one point I thought I needed a cross platform Unzip capability and I didn't like anything I found. My solution was to use a shell object and let the OS do the work. The old code I have follows. Hope it will be useful.

*************************
 Dim s as shell
 Dim absp, cmd as string
 Dim Serr as integer
 absp = TTF.shellpath   // TTF is the folderitem of the zipped file
 s = New shell
 #IF targetWin32 Then
   cmd = "gzip -d " + absp
 #Else
   cmd = "gunzip " + absp
 #endif
 s.execute cmd
 serr = s.errorCode
 If  serr <> 0 then
   editfield1.text = "Have shell error " + Str(Serr)
 else
   beep
 End if
 TTF = NIL
 // file suffix must be "gz" for OS X and Linux (works correcty)
 // suffix must be zip for windows (hangs windows 98) and command
 // gunzip or gzip -d, or zip -d, didn't try unzip yet
Exception Error
 App.LocStr = " MF 3"
 App.HandleError(error)
***********************************

Regards,
Jim Payne
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to