OS2 World.Com Forum
2012.05.25, 23:51:58 *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Zip/Unzip with rexx  (Read 1302 times)
jep
Global Moderator
Sr. Member
*****
Posts: 402


View Profile
« on: 2008.04.08, 20:43:45 »

Hello,

can someone explain how to unzip with rexx and possibly zip as well?
( unzip32.dll )


//Jan-Erik
Logged
warpcafe
Global Moderator
Hero Member
*****
Posts: 746


Failure is not an option.


View Profile
« Reply #1 on: 2008.04.08, 21:40:19 »

Hi jep...

 Huh
Since you know about the existence of the dll... you should have this (see below) too
That's from the InfoZip source distro, subfolder "OS2", file "rexxtest.cmd":

Code:
/* Test REXX UnZip API */
call RxFuncAdd 'UZLoadFuncs', 'UNZIP32', 'UZLoadFuncs'
call UZLoadFuncs

parse arg all

say; say 'Demonstrating UZUnZip' UZUnZip(all,'TEST.')
do num=1 to test.0
  say num':'test.num
end

/*** Demonstrate UZFileTree ***/
fname = 'g:\cqc\channel1\12-30.qwk'
say; say 'Demonstrating UZFileTree by displaying all entries in',
          fname
exc.0 = 2
exc.1 = '*.dat'
exc.2 = '*.ndx'
call UZFileTree fname, 'files','','exc'
do num=1 to files.0
  say num':'files.num
end

say; say 'Demonstrating UZUnZipToVar -' UZUnZipToVar(fname,'CONTROL.DAT')


test. = 0
say; say 'Demonstrating UZUnZipToVar -' UZUnZipToVar(fname,'CONTROL.DAT','test.')
SAY "Test =" test.0
do num=1 to test.0
  say num':'test.num
end

test. = 0
say; say 'Demonstrating UZUnZipToStem -' UZUnZipToStem('\SourceCode\cqc\cqcmain.zip','test',"*.rch",,'T')
call recout "test"

say; say 'Demonstrating UZVer -' UZVer()

call UZDropFuncs
exit

recout: PROCEDURE EXPOSE test.
parse arg this
say this "Contains" value(this'.0') "entries"
do num=1 to value(this'.0')
  tval = value(this'.'num)
  say "Got" this'.'num':' tval
  if Right(tval,1) = '/' then
     call recout this'.'left(tval,length(tval)-1)
  else
     say "Contains:" value(this'.tval')
end
return

Unzip source at SourceForge:
http://sourceforge.net/project/showfiles.php?group_id=118012&package_id=128992

Zip source at SourceForge:
http://sourceforge.net/project/showfiles.php?group_id=118012&package_id=128993
(Didn't find rexx sample for zip though, however no time left, will call back...)

Cheers! ;-)
Thomas
Logged

"It is not worth an intelligent man's time to be in the majority.
By definition, there are already enough people to do that"
- G.H. Hardy
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.14 | SMF © 2006-2011, Simple Machines LLC Valid XHTML 1.0! Valid CSS!