[plt-scheme] Guessing the file type?

From: Amit Saha (lists.amitsaha at gmail.com)
Date: Sun Jul 26 11:40:12 EDT 2009

Amit Saha wrote:
> Jay McCarthy wrote:
>> On Unix/OS X there is a program called 'file' that works pretty well.
> Yep. I was looking for a plt-scheme interface..
>> Also, if you use the mime type library in the PLT Web server, it uses
>> the system database of file extensions to return a mime type.
> Yeah..I came across this. However, I thought of consulting the list to 
> enquire if there was another way..

I have used 'make-path->mime-type' which gives back a procedure for the 
relevant MIME type. For eg:

 > (make-path->mime-type (build-path "/home/r00t/Music/" "m.mp3"))

Not sure, how can I obtain the MIME type now? I can see: 
make-get-mime-type : path? -> path? -> bytes? in private/mime-types.ss. 
Again not sure, how it can be used..

Please suggest.

email: amitsaha.in at gmail.com
Journal: http://amitksaha.wordpress.com
µ-blog: http://twitter.com/amitsaha
IRC: cornucopic on #scheme, #lisp, #math, #linux

Posted on the users mailing list.