[Tutor] opening a file directly from memory

Alan Plum alan.plum at uni-koeln.de
Tue Nov 17 22:50:03 CET 2009


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




More information about the Tutor mailing list