[plt-scheme] Guessing the file type?

From: Marek Kubica (marek at xivilization.net)
Date: Mon Jul 27 08:23:07 EDT 2009


On Mon, 27 Jul 2009 09:24:23 +0530
Amit Saha <lists.amitsaha at gmail.com> wrote:

> Great. On my Ubuntu Linux:
>  > ((make-path->mime-type "/etc/mime.types") (build-path 
> "/home/r00t/Music/" "m.mp3"))
> #"audio/mpeg"
> does it.
> Now wondering: How would I go about writing code, such as this- to
> work on Linux as well as say, a Mac OSX ?

By checking for the OS and setting the path to the MIME Database
accordingly. The biggest problem I see would be Windows, which as far
as I know does not have such a file at all.


Posted on the users mailing list.