On 17/03/2010 15:48, Rafael Teixeira wrote:
> How does one determine the mime-type of a resource (normally a file)
> in a portable way?
> I know Mono on Debian does have a dependency on the shared-mime-info
> package, so it probably wraps/uses it, but is it exposed in some
> public API? Specially some API that is available in .NET?

I had the same problem and I didn't find any portable way to determine
the MIME type of a file. In the end we resolved to just hardcode the
most common file types (by extension, sigh) into our code:

https://dndg.it/cgi-bin/gitweb.cgi?p=public/wok-2.git;a=blob_plain;f=Wok.Core/Wok.Core.Utils/MimeType.cs;hb=HEAD

-- 
Federico Di Gregorio                                       f...@initd.org
 Questa lista non pretende di essere il riferimento torinese per il
  software libero o altre cazzate del genere.       -- Silvano, su torte

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list

Reply via email to