home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / con2v766.zip / cn2_76_6.zip / util / unzip_.cmd < prev    next >
OS/2 REXX Batch file  |  2000-08-08  |  911b  |  49 lines

  1. /* CONNECT's wrapper for InfoZip's ZIP */
  2.  
  3. /* input: "unzip_.cmd -b $SWAPDIR -g -D -S $ARC $SRC"
  4.  *        "unzip_.cmd -b n:\temp -g -D -S n:\suxx.zip @@selected.lst"
  5.  *        "unzip_.cmd -b n:\temp -g -D -S n:\suxx.zip filename.txt"
  6.  */
  7.  
  8. call RxFuncAdd 'SysLoadFuncs', 'rexxutil', 'SysLoadFuncs'
  9. call SysLoadFuncs
  10.  
  11. parse arg args
  12.  
  13. if pos( '@@', args ) > 0 then do
  14.  
  15.     parse arg args' @@'list
  16.     lst = ''
  17.  
  18.     call stream list, 'c', 'open read'
  19.  
  20.     do while stream( list, 's' ) = 'READY'
  21.  
  22.         s = linein( list )
  23.         lst = lst || ' ' || s
  24.  
  25.         if length( lst ) > 512 then do
  26.  
  27.             'unzip.exe ' || args || ' ' || lst
  28.             lst = ''
  29.  
  30.         end
  31.  
  32.     end
  33.  
  34.     call stream list, 'c', 'close'
  35.  
  36.     if length( lst ) > 0 then
  37.  
  38.         'unzip.exe ' || args || ' ' || lst
  39.  
  40. end
  41. else do
  42.  
  43.     parse arg args
  44.     'unzip.exe ' || args
  45.  
  46. end
  47.  
  48. exit 0
  49.