9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: geoff@plan9.bell-labs.com
To: 9fans@9fans.net
Subject: Re: [9fans] a question of file and the history of magic
Date: Sun,  6 Jul 2008 19:45:28 -0400	[thread overview]
Message-ID: <6223deca086f7deac23b9f3a53cc0d34@plan9.bell-labs.com> (raw)

As far as I know, all (l)unix dd commands from at least sixth edition
unix forward accept the options if=, bs= and count=, so portability
across (l)unix systems shouldn't be a problem.  Not all (l)unix dd
commands have some of the newer options, such as iseek= and oseek=,
but the ones I have seen all take the same syntax.

An assumption behind the system v magic file is that almost all file
does is match byte strings or integers, usually at the start of the
file being examined (though that wasn't really true even on unix).
The plan 9 file command also uses more complex algorithms; it's not
all simple table-driven matching.  It understands unicode and utf.  It
may look at histograms of byte or word distributions.  It may look for
programming language keywords.  It understands a.out and elf headers.
It can recognise a tar header and distinguish posix from non-posix
headers.  It can recognise html, rfc-822 mail messages, unix-style
mailboxes, images, compressed files and encrypted ones, and more.  A
quick look suggests that under 15% of the lines in file.c are devoted
to table definitions.




             reply	other threads:[~2008-07-06 23:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-06 23:45 geoff [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-07-07  8:58 Harri Haataja
2008-07-11 16:21 ` Dan Cross
2008-07-06 21:20 erik quanstrom
2008-07-06 21:59 ` Brantley Coile
2008-07-06 22:31 ` Bakul Shah
2008-07-06 22:44   ` Charles Forsyth
2008-07-06 19:30 erik quanstrom
2008-07-06 21:00 ` Jeff Sickel
2008-07-06 18:16 Jeff Sickel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6223deca086f7deac23b9f3a53cc0d34@plan9.bell-labs.com \
    --to=geoff@plan9.bell-labs.com \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).