[openbeos] Re: question about dos filesystem and mime types

  • From: "Axel Dörfler" <axeld@xxxxxxxxxxxxxxxx>
  • To: openbeos@xxxxxxxxxxxxx
  • Date: Fri, 01 Sep 2006 10:20:40 +0200 CEST

Ingo Weinhold <bonefish@xxxxxxxxxxxxxxx> wrote:
> On 2006-08-31 at 19:20:20 [+0200], Axel Dörfler <axeld@xxxxxxxxxxxxxxxx> 
> > wrote:
> > "Jérôme Duval" <korli@xxxxxxxxxxxxxxxx> wrote:
> > > I'm wondering why we bother supporting reading "BEOS:TYPE" 
> > > attribute
> > > for files located on a dos file system. Shouldn't it be the job 
> > > of
> > > the registrar/mime registry anyway ?
> > The problem is that files without such attribute are handled as 
> > generic
> > files; the registrar only sets this attribute after having sniffed 
> > the
> > file, and Tracker (ie. the roster on Launch()) can then work with 
> > it.
> > I'm not sure how we could do this differently, even though it looks
> > desirable.
> I actually don't quite understand the problem. MIME sniffing (by 
> extension 
> and/or contents) should work just well for files on volumes not 
> supporting 
> MIME types. I believe this is merely a question of extending the 
> Tracker to 
> sniff the file types, if the volume doesn't support them. And if 

Yes, indeed, we could change Tracker to sniff the types - this would 
make sense for BFS volumes as well, but it could also slow down opening 
directories with many files considerably for volumes without attribute 
support if there is extra communication involved for every file. So 
this should be either cached at the file system level or somewhere else 
- if we go with the file system, the B_FS_HAS_MIME flag could indicate 
that the file system supports storing the type at least volatile (as 
long as the vnode stays in memory).

> BRoster::FindApp/Launch() don't handle files on those volumes 
> correctly, 
> they simply should be fixed.

I haven't tried it under Haiku, but at least Dano doesn't work 
correctly in this regard - but sure, that's fixable.

Bye,
   Axel.


Other related posts: