home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 2 BBS / 02-BBS.zip / flink11.zip / FileType.cmd < prev    next >
OS/2 REXX Batch file  |  1995-02-28  |  712b  |  35 lines

  1. /* hejsan
  2.  
  3.  c:\file\upload\vgademo.zip
  4.        1            2      3
  5. */
  6.  
  7. parse arg File
  8.  
  9. if File = '' then call usage
  10.  
  11. result = stream( File, 'c', 'open read' )
  12.  
  13. select
  14.   when charin(File,1,4) == x2c(504b0304) then t='Zip'
  15.   when charin(File,3,5) == "-lh5-"   then t='Lha'
  16.   when charin(File,3,3) == "-lh"     then t='Lzh'
  17.   when charin(File,1,1) == x2c(1a)   then t='Arc'
  18.   when charin(File,1,4) == "DMS!"    then t='Dms'
  19.   when charin(File,1,2) == x2c(60ea) then t='Arj'
  20.  otherwise
  21.   t='Unknown compression method.'
  22. end
  23.  
  24. result = stream( File, 'c', 'close' )
  25.  
  26. return t
  27.  
  28. usage:
  29.   say
  30.   say 'Usage: '
  31.   say '     cmd: FileType <file>'
  32.   say '    rexx: filetype( file );'
  33.   exit
  34.  
  35.