[E-Lang] Announcing the Interim Internal E stl-0.8.9p Release
Ka-Ping Yee
ping@lfw.org
Sat, 10 Feb 2001 15:34:38 -0800 (PST)
On Fri, 9 Feb 2001, Mark S. Miller wrote:
> Anyone know how to create file extension associations from KDE or Gnome? Is
> it per desktop environment, or is there a more widely accepted way to do
> this? Can it be done from Java?
Most programs use the "mime.types" and "mailcap" files to accomplish
this. The former establishes extension-to-file-type bindings; the
latter establishes file-type-to-application bindings. All you have
to do is add a line to ~/.mime.types like this:
type=text/e-script desc="E script" exts="e"
and a line in ~/.mailcap like this:
text/e-script; java org.erights.e.elang.syntax.EMain %s
The corresponding files at a system-wide level are /etc/mailcap
and /etc/mime.types, but those are only writable by root.
I would expect that if KDE and GNOME were reasonably implemented,
they would honour the information in these files for backward
compatibility. I don't know if they do, though.
Detailed instructions for exactly what to do with GNOME at
http://developer.gnome.org/doc/whitepapers/SystemConfig/mime-info.html
and with KDE at
http://www.antipope.org/charlie/nonfiction/linux/wibble/kde_custom.html
In all cases this just involves installing a few small text files,
so it is pretty easy to do from anywhere, including Java.
-- ?!ng
Happiness comes more from loving than being loved; and often when our
affection seems wounded it is is only our vanity bleeding. To love, and
to be hurt often, and to love again--this is the brave and happy life.
-- J. E. Buchrose