finding mimetype of file

Benedikt Meurer benny at xfce.org
Sat Nov 19 14:16:46 CET 2005


Jani Monoses wrote:
>>Both file extensions and "magic" characteristics are available in the 
>>shared-mimetype package. Tailoring this to your particular needs may 
>>produce smaller/faster code.
> 
> thanks Edscott,
> 
> I was more interested whether there's a preferred library to do this for
> xfce apps rather than rolling my own. Until now I used libmagic (the one
> from file(1)) but that doesn't use the fd.o mimetype database.

Basicly you can use:

(1) libxfcegui4's mime module (which is also available with the 4.2.x 
releases)
(2) thunar-vfs (similar in functionality to gnome-vfs)
(3) xdgmime (plain frontend to the shared-mime-info package)
(4) gnome-vfs (which uses xdgmime with some extra magic)

API Documentation is available for (1), (2) and (4). It's up to you to 
choose whatever fits best for your particular application.

> Jani

greets,
Benedikt
-- 
Xfce  --  small, stable, fast  --  http://www.xfce.org/

           (__)
           (oo)
     /------\/
    / |    ||
   *  /\---/\
      ~~   ~~
...."Have you mooed today?"...



More information about the Xfce4-dev mailing list