Re: Filetype identification in gmc





On Wed, 4 Aug 1999, Iain wrote:

> > > Yup, that's the story I got a few months back when I complained about
> this.
> > > Mostly it doesn't matter too much.  But since Perl libraries and X
> Pixmaps both
> > > use *.pm, it *can* have some funny results =OZ
> >
> > gnome-libs provides functions to determine the mime type both from file
> > extension and magic numbers.  Perhaps gmc could be modified to use magic
> > numbers if file extensions are ambiguous.  hmm.  if i remember tonight
> > maybe I'll give it a look.
> 
> How about using the extension for display of icons, but the magic numbers
> when you double click the file? This way the file would only have to be read
> when you're opening it, so it wouldn't cause much slow down.
> And then, it could check if it got the icon wrong, for example, a text file
> called text.jpg would originally have a picture icon, but when you double
> click on it, the magic numbers are checked, it turns out to be a plain text
> file, emacs (or whatever) is opened for it, and the icon changes to a text
> icon, thus ignoring the (wrong) .jpg extension.

I was also thinking about doing a "lightweight" descision while viewing
the directory and a "heavyweight" descision when doubleclicking on a file.
However I decided that doing that is bad since it would be a big surprise
for Joe User when he discovers that what happened was far from what he
thought would happen.

Doing a thorough checkup in the background breaks when you sort on
filetype. So this looks like a lose-lose situation. :-(

Ideally we would want a filesystem that includes the filetype in the
stat() call, but that's ... way off I think.

Another thing: I don't actually use gmc (more of a Dir.Opus guy) but
one thing I would really want to see is the ability to register more
than one program for a certain filetype. On my Redmond box I have
several imagemanipulationprograms (gee) installed and ... well
#%"#%$&£¤½@#!!!:-)  So, I would just like to right click on a
jpg and Open_with->Gimp  or Open_with->ee  or Open_with->whatever.

Cheers.

-- 
Per Erik Stendahl




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