home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / bugs / sys5 / 171 < prev    next >
Encoding:
Internet Message Format  |  1993-01-10  |  1.7 KB

  1. Path: sparky!uunet!auspex-gw!guy
  2. From: guy@Auspex.COM (Guy Harris)
  3. Newsgroups: comp.bugs.sys5
  4. Subject: Re: Improving "file" (was Re: Making Solaris 2.1 smarter...)
  5. Message-ID: <16329@auspex-gw.auspex.com>
  6. Date: 10 Jan 93 23:18:57 GMT
  7. References: <16235@auspex-gw.auspex.com> <C0Hoqv.GtJ@vuse.vanderbilt.edu> <16320@auspex-gw.auspex.com> <1993Jan10.143907.12860@ulysses.att.com>
  8. Sender: news@auspex-gw.auspex.com
  9. Distribution: na
  10. Organization: Auspex Systems, Santa Clara
  11. Lines: 26
  12. Nntp-Posting-Host: auspex.auspex.com
  13.  
  14. >instead of changing the magic file format to handle BE/LE,
  15.  
  16. Too late, I've *already* changed it, and nobody's yet shown any
  17. disadvantages to doing so....
  18.  
  19. >by having one file (and one magic file) we get the same output for
  20. >a given set of input files no matter what host file runs on and we
  21. >avoid the magic file duplication that would be required with
  22. >short-beshort-leshort and long-belong-lelong
  23.  
  24. I just changed all the magic numbers for VAX and i386 "a.out" and COFF
  25. executables to use "le{short,long}" and all the "a.out" and COFF magic
  26. numbers for architectures I knew were big-endian to "be{short,long}"; no
  27. duplication was required there.
  28.  
  29. ELF required a little duplication, so that it extracts the various
  30. fields in the right byte order for the architecture.
  31.  
  32. That was the *only* duplication required; the same "magic" file works on
  33. big-endian and little-endian architectures (although you may want to
  34. change what entries appear if, say, some particular magic number is used
  35. both for TLA, Inc.'s "a.out" files and FroboTech PLC's "a.out" files).
  36.  
  37. What happens if you have a field whose value you don't test at all, or
  38. test with a test other than one for equality or inequality, and whose
  39. value you later print?
  40.