Re: Filetype identification in gmc



There is already a trimed down version of the file command inside
libgnome.  It is designed to give a mime type from the magic inside a
file, rather than the amount of information given by the normal file
command, so is probably a bit quicker.

Still, it would still take a long time to process all the files in a
100000 file directory on a slow NFS partition.  On the other hand, it may
be useful to be able to turn the mime magic code in the preferences.

James.

--
Email: james@daa.com.au
WWW:   http://www.daa.com.au/~james/


On Wed, 4 Aug 1999, Matthias Warkus wrote:

> +++ Wed, Aug 04, 1999 at 01:56:56PM +0200 +++
> Per Erik Stendahl e-mails me. Film at 11. Reply right now, after the break.
> > 
> > Hi.
> > 
> > It seems to me (and I always reserve the right to be wrong) that
> > gmc determines the type of a file solely on the extension it has.
> > I don't like this, it is not powerful enough and it seems like
> > just-another-MSDOS-ripoff. I think that filetype identification
> > should be able to use at least filename patterns (like extensions),
> > locations and file contents. Take for instance the .doc extension.
> > Is it a text document? Is it an MS Word document? Is it an airplane?
> > 
> > I don't know exactly how the 'file' command determines the type of
> > a file, maybe we could use that.
> 
> The problem here is that it doesn't scale, if you've got a directory
> with 10,000 files, you need to do 10,000 calls to file, which spawns
> 10,000 processes one after another and does 10,000 open() calls.
> 
> Over a network, this could take hours.
> 
> mawa
> -- 
> They're expending enough energy just taking in oxygen on a daily
> basis, you think they have any synaptic activity left over to devote
> to Intelligent Thought?
>                           -- Synth F. Oberheim <synth@yenta.alb.nm.us>
> 
> 
> -- 
>         FAQ: Frequently-Asked Questions at http://www.gnome.org/gnomefaq
>          To unsubscribe: mail gnome-list-request@gnome.org with 
>                        "unsubscribe" as the Subject.
> 



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