[plt-scheme] Guessing the file type?
Hi,
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.
regards,
Marek