[haiku] Re: Sniff Rules?

  • From: Pete Goodeve <pete.goodeve@xxxxxxxxxxxx>
  • To: haiku@xxxxxxxxxxxxx
  • Date: Sun, 3 Mar 2013 23:47:21 -0800

On Sun, Mar 03, 2013 at 10:42:54PM +0100, Fran?ois Revol wrote:
> On 03/03/2013 22:37, pete.goodeve@xxxxxxxxxxxx wrote:
> > There's no way, is there, of getting a listing of *all* types and their
> > sniffer rules in priority order? 
> 
> You can send a patch against src/bin/setmime.cpp ;-)

It would've been such a help if I'd known of that app yesterday... (:-/)

Not quite sure how I missed it -- thought I'd done "ls /bin/*mime*"
at one point.  Whatever, I now see it does most of what I wanted.
[I note that it's not even mentioned in the list of bin apps in the
Users Guide.  Not sure how it got omitted there -- I found it even
on my BeOS machine!]

I'm not going to bother working out a patch, though.  The following
command script does what I want (:-)):

  setmime -dumpSniffRule|
   matt '.*-set ([^ ]+) -sniffRule \q([0-9\.]+)([^\q]*\q)' -o '$2\t$1 
\t\q$2$3\n'|
   sort -b -k2,2.4 -k1,1

("What's matt?" I hear you ask... Just an app I wrote ten years ago.
Can't persuade anybody else to use it, but I regularly do the sort of
thing above with it.)

        -- Pete --

Other related posts: