home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / webautoz.zip / webautoz.cmd < prev   
OS/2 REXX Batch file  |  1998-02-21  |  915b  |  35 lines

  1. /**/
  2. Call RxFuncAdd 'SysLoadFuncs', 'REXXUTIL','SysLoadFuncs'
  3. Call SysLoadFuncs
  4. parse upper arg zipfile
  5. call directory 'h:\dl'
  6. '@echo off'
  7. slash = lastpos("\",zipfile)
  8. extlength = length(zipfile) - lastpos(".",zipfile)
  9. say extlength
  10. baselen = (length(zipfile) - slash) - (extlength + 1)
  11. basename = substr(zipfile, slash + 1, baselen)
  12. extension = right(zipfile, extlength)
  13. target = translate(directory())"\"basename
  14. call SysMkDir basename
  15. call directory basename
  16. select
  17.    when extension = 'ZIP' then
  18.       call extract unzip
  19.    when extension = 'GZ' then
  20.       call extract gzip -drv
  21.    when extension = 'TAR' then
  22.       call extract tar -xvf
  23.    otherwise
  24.       say "Copying" zipfile "to directory" target
  25.       'copy' zipfile .
  26. end
  27.  
  28. call SysSetObjectData directory(), "OPEN=ICON;"
  29. exit
  30.  
  31. extract:
  32.    say "Extracting" zipfile "to directory" target
  33.    ''arg(1) arg(2) zipfile
  34. return
  35.