home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / os / os2 / apps / 7953 < prev    next >
Encoding:
Text File  |  1992-11-08  |  1.8 KB  |  44 lines

  1. Newsgroups: comp.os.os2.apps
  2. Path: sparky!uunet!ukma!wupost!uwm.edu!linac!uchinews!ellis!roe2
  3. From: roe2@ellis.uchicago.edu (Cave Newt)
  4. Subject: Re: UNIX 'file' program for OS/2?
  5. Message-ID: <1992Nov6.203944.18137@midway.uchicago.edu>
  6. Sender: news@uchinews.uchicago.edu (News System)
  7. Reply-To: roe2@midway.uchicago.edu
  8. Organization: University of Chicago
  9. References: <1daie3INN79v@iskut.ucs.ubc.ca> <1992Nov5.193250.6913@midway.uchicago.edu> <1992Nov5.231649.14862@netcom.com>
  10. Date: Fri, 6 Nov 1992 20:39:44 GMT
  11. Lines: 31
  12.  
  13. I wrote:
  14.  
  15. >>Unfortunately, you really *must* dig out the OS/2 structure in the
  16. >>program itself, not via a magic file, since the "meat" is not at a
  17. >>fixed location (only a pointer to it is).  OS/2 programs look like
  18. >>DOS programs if you don't make use of that pointer...
  19.  
  20. xtifr@netcom.com (Chris Waters) writes:
  21.  
  22. > Well, but the following entries in *my* /etc/magic seem to work ok:
  23. > 0               short           0x5A4D          DOS executable
  24. > >0x18           short           0x40            -- OS/2 format
  25.  
  26. OK, I made a slight misstatement:  OS/2 programs look like *Windoze*
  27. programs (a small subset of DOS programs :-) ).  In addition, this
  28. doesn't tell you whether it's NE format (1.x) or LE/LX/whatever format
  29. (2.x).  I don't know about the original poster, but that's definitely
  30. something *I* want to know, so I'll stand by my claim.
  31.  
  32. Finally, the entry would be improved if you used string variables--
  33. integers aren't the same on big- and little-endian systems, and many
  34. of us download stuff to Unix systems first.  Thus:
  35.  
  36. 0    string        MZ            MS-DOS executable
  37. >24    string        @            (OS/2 or Windows format)
  38.  
  39. Greg Roelofs
  40.  
  41. P.S.  I posted a bunch of compression-format magic entries to both
  42.       alt.sources and comp.compression a few weeks ago.  The original
  43.       poster might be interested in those.
  44.