[haiku] Re: Sniff Rules?

  • From: pete.goodeve@xxxxxxxxxxxx
  • To: haiku@xxxxxxxxxxxxx
  • Date: Sun, 3 Mar 2013 13:37:30 -0800

On Sun, Mar 03, 2013 at 10:22:45AM +0100, Humdinger wrote:
> There was an explaination in BeOS R5's release notes to the Storage 
> kit, [....]
> Even better is darkwyrm's "Programming with Haiku" series. Lesson 15 
> "Making a New File Type" [2] deals with sniffer rules.
> [....]
> [2] 
> https://www.haiku-os.org/blog/darkwyrm/2010-12-12_lesson_15_making_new_file_type
Now *that* is the reference to use!  Thanks for pointing to it.
The BeBook page doesn't mention a lot of the features that I saw
in rules that I looked at, but Jon covers them all.

My only tiny minor point of disagreement is his insistence on single quotes
around a pattern.  I just followed all the other rules I saw in using
double quotes, and they work fine.

[Also not sure why on earth anyone would want to use scientific
notation in a priority...!  Just to be obscure, I suppose...]

He doesn't mention that FileTypes has an option to see/set the
Sniffer Rule, but I suppose that's more recent than his essay.

Also, Ingo's point that there are built-in rules and priorities
should be mentioned somewhere, or others might be as confused as I was!

There's no way, is there, of getting a listing of *all* types and their
sniffer rules in priority order?  That would be nice -- it would make
it easier to decide what priority to give a new rule.

        -- Pete --

Other related posts: