On Thu, 30 Dec 1999, Dirk Ritter wrote: > This leads me to a final question - maybe you want your shell's > interpreter hack to decide what interpreter to run based on the > file type? Of course - text files can be made executable and if > you write '#/bin/emacs' in the first line you will be able to start > emacs and load the file you want to edit. This is ugly since it will > break under GNU/Linux where emacs is under '/usr/bin' and of course > it would corrupt JPEG data, so the mechanism needs to be extended. > Since some people might just want to prefer different applications > for their work this needs to be made configurable at least on a per > user base - something that is an ideal job for something like gnome > core components or similar applications - do you still feel that it > is beneficial to offer such functionality inside core OS components > such as file systems or exec servers? I doubt it.
Using #! wouldn't be a very good solution. You could solve the path problem and make it user-configurable hacking the #! header interpreter to take something like '#!text-editor' or '#!gz-uncompress', so it could be user-configurable (User A sets text-editor to vi, User B sets it to emacs). However, this only allows one action per user to be taken upon exectution of the file. A nice solution would be nearly like W95's system for executing files, except using the 'file' command (or something similar that returns a MIME type) to get the file's type instead of using the file's extension. For a GUI, this wouldn't be too hard to do, but in text-mode, you might want a 'run' program to take the default action. Also have an 'alt' program to give a list of all actions, and let the user select one. The system could have a global database of actions for each file type, and users could have their own preferences. Note: For those fortunate enough to not have used '95, double-left-clicking on a file uses a default action for that extension type, and right-clicking brings up a menu of all actions registered for that extension. Each action has a name ('Edit') and the program to use for it ('/bin/vi'). Unknown file types have the default action of 'Open with...'. Mark Lundeberg <[EMAIL PROTECTED]> http://www.pgfn.bc.ca/~aa026/