home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 14 / AACD14.ISO / CDTools / S / AAExtract < prev    next >
Text File  |  1999-12-15  |  1KB  |  47 lines

  1. /*
  2.     $VER: AAExtract 1.1 (15.12.99)
  3.     (c) Neil Bothwick, Wirenet
  4. */
  5.  
  6. address command
  7. options results
  8. call addlib('rexxsupport.library',0,-30,0)
  9. call addlib('rexxdossupport.library',0,-30,0)
  10. options failat 21
  11. ExtractPath = 'RAM:'
  12. ExtractPath = AddPart(ExtractPath,'')
  13. CDName = pragma('D')
  14. parse var CDName CDName ':' .
  15. if left(CDName,4) ~= 'AACD' then CDName = 'AACD'
  16.  
  17. parse arg Archive
  18. Ext = upper(substr(Archive,lastpos('.',Archive) + 1))
  19.  
  20. select
  21.     when pos(Ext,'LHA LZH') > 0 then do
  22.         'LhA x "'Archive'" "'ExtractPath'"'
  23.         if RC > 0 then 'RequestChoice >NIL: "Amigactive CD" "An error occured*Nwith this archive" "OK"'
  24.         else 'rx REXX:AAShowDir' ExtractPath
  25.         end
  26.     when pos(Ext,'DOC TXT README GUIDE') then 'AACDFile "'Archive'"'
  27.     when Ext = 'TGZ' then do
  28.         'UnTGZ x "'Archive'" "'ExtractPath'"'
  29.         if RC > 0 then 'RequestChoice >NIL: "Amigactive CD" "An error occured*Nwith this archive" "OK"'
  30.         else 'rx REXX:AAShowDir' ExtractPath
  31.         end
  32.     when Ext = 'ZIP' then do
  33.         'UnZIP x "'Archive'" "'ExtractPath'"'
  34.         if RC > 0 then 'RequestChoice >NIL: "Amigactive CD" "An error occured*Nwith this archive" "OK"'
  35.         else 'rx REXX:AAShowDir' ExtractPath
  36.         end
  37.     /* when Ext = 'DMS' then */
  38.     when pos(Ext,'MPG ANIM GIF JPEG JPG PNG') > 0 then 'AACDFile "'Archive'"'
  39.     otherwise do
  40.         'copy "'Archive'" "'ExtractPath'" clone quiet'
  41.         if RC > 0 then 'RequestChoice >NIL: "Amigactive CD" "An error occured*Nwith this archive" "OK"'
  42.         else 'rx REXX:AAShowDir' ExtractPath
  43.         end
  44.     end
  45.  
  46.  
  47.