The information is out there somewhere because the graphical
shell Nautilus allows you to click on an arbitrary file to run it
or view it.
Also, I seem to recall the Mac has the "open" command to
let you do this.
Thanks,
Keith
It is embedded in Nautilus or part of Gnome's Desktop binding (or
something like that). Neither Nautilus, Gnome, or KDE, etc. are
invoking some sort of Linux system service or anything. Outside of the
coded bindings in the Desktop manager or Window manager, there isn't
anything like either the MS-Windows 'cmd.exe /c start' or the MacOSX
'open' command in Linux (or any other UNIX or Posix system. Things like
executable files, whether they are binary machine code (eg ELF) or
things like shell scripts are handled by what the first bytes/line(s)
contain ('magic' codes).
I suspect that Nautilus runs the file command and uses the result to
index into a lookup table to see what to do. Probably using file in
MIME mode (-i, --mime), in which case it might use the same magic as is
typically used by webrowsers to match MIME types with helper
applications.
>
> Thanks,
> Keith
>
--
Robert Heller -- 978-544-6933
Deepwoods Software -- Download the Model Railroad System
http://www.deepsoft.com/ -- Binaries for Linux and MS-Windows
hel...@deepsoft.com -- http://www.deepsoft.com/ModelRailroadSystem/
In the dark ages of UNIX desktops, programs usually used the "mailcap"
file to find the correct invocation for a given MIME type. Today the
associations are stored somewhere in the KDE or Gnome settings. There is
also the freedesktop standard which cares about these specifications;
read e.g.
http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec
maybe in KDE it's possible to simply invoke konqueror on any file. You
probably need some heuristics to find out, whether KDE or Gnome is used;
otherwise stick to mailcap.
Christian
exec gnome-open $filename
?
This seems to actually work, even if the Gnome Desktop is not running...
>
> ?