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