home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / BITS.ZIP / bits.cmd
OS/2 REXX Batch file  |  1993-01-09  |  1KB  |  37 lines

  1. /*┌────────────────────────────────────────────────────────┐
  2.   │ bits.cmd                                               │
  3.   │ A REXX procedure to determine if an OS/2 binary file is│
  4.   │ compiled as 16-bits "NE" or 32-bits "LX"               │
  5.   │ Thanks go to Craig Swanson for the above information.  │
  6.   │ Last revision: 9 January 93                            │
  7.   │ Syntax: bits filespec                                  │
  8.   └────────────────────────────────────────────────────────┘*/
  9.  
  10. if arg() = 0 then signal Suggestion
  11.  
  12. parse arg filename
  13.  
  14. signature = charin(filename, 129, 2)
  15.  
  16. select
  17.    when signature = "NE" then
  18.       do
  19.       say filename "is a 16-bit New Executable binary file."
  20.       exit
  21.       end
  22.    when signature = "LX" then
  23.       do
  24.       say filename "is a 32-bit Linear eXecutable binary file."
  25.       exit
  26.       end
  27.    otherwise say "Let's confine ourselves to OS/2 binary files, chief!"
  28. end
  29.  
  30. call stream filename, 'c', 'close'
  31.  
  32. exit
  33.  
  34. Suggestion:
  35. say 'Syntax example: bits foo.exe'
  36. exit
  37.