Re: How do I create a mime-type for files with no extension?



Miguel de Icaza wrote:

> > For example, README.  I tried doing this by creating a mime-type and
> > giving it no extension.  It showed up in the list, so I edited it and
> > added an application to be associated to it and hit OK.  However, when I
> > went back into mime-types, my entry didn't appear (and of course gmc
> > didn't use it when I double-clicked on README).  So I re-created the
> > same one, and this time gave it a bogus extension.  When it appeared,
> > the applications I had typed previously were already associated with it.
>

    Ok, I think I finally figured out how to make this work.  In case anyone
has forgotten what this thread was all about, I was trying to create a
mime-type to handle "miscellaneous" files, or those without anything already
associated with it.  This would include files with no extension.
    Here's how to do it:
In gnomecc, create a new mime-type.  I called mine text/misc.  For the
extension, enter ".".  For the first regular expression, enter ".".  Now try
it out.  It should work.  Of course you can change the applications to be
whatever you want (I use nedit).
    Thanks to Miguel for hinting at regex's.  I didn't know much about them
before, but they were the key to getting this to work for files with
different extensions (i.e. readme.1st).  Maybe this information could be a
candidate for the FAQ, or perhaps this should be part of the default
mime-types shipped with gnome?

Dan




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]