How can I determine the mime-type of a file (in OCaml)?
I am trying to set the language for a GtkSourceView control, but to do that, I need to first determine the language. The only way I can see of doing this is using the mime-type - there is a function that will return the correct language as follows:
GSourceView.source_languages_manager#get_language_from_mime_type : string -> source_language option
I really don't want to hard code the language into my source. If it isn't possible to determine the mime-type in OCaml (and I haven't yet found a way, after searching through the documentation), is there perhaps another way I can determine the source language?