Dammit. Meant to send this over the list. Sorry, Alan. On Di, 2009-11-17 at 21:33 +0000, Alan Gauld wrote: > Unices, like Linux have file association tables - but these > are often associated with the desktop environment - KDE, Gnome etc. > Finally for text files you should check the EDITOR and VISUAL > environment variables - although these are increasingly not > used or respected nowadays.
I find mimemagic to be quite reliable. File can be silly at times (it routinely diagnoses my python scripts as Java source files). In my gopher server I rely on mimemagic to make an educated guess and only use file(1) as a last resort to find out whether it's a binary file or ASCII text (some gopher clients don't support UTF8). I'm not sure whether mimemagic is also available on other OSes, tho. Cheers Alan _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor