starter Version 1.0 for BeOS

starter 1.0 for BeOS.

by Willy Langeveld

What is it?

starter is a simple program that executes commands based on the file type and extension of the argument(s).

The main use for this program is to circumvent a limitation in BeOS: the preferred application for a given type of file can only be a binary application, not a script. By making the preferred application for a given filetype application/x-vnd.VL-starter you can get around this limitation, and the application that processes that filetype can be a script.

Note, that this limitation may disappear in future releases of BeOS, but as of release 4.5.2 it is still there.

How does it work?

In order to know what to do, starter looks in a configuration file, /boot/home/config/settings/starter.conf.

The entries in this file should be of the form:

<mime-type>      <extension>        <action>   [<action2> [...]]

for example:

text/x-source-code      .cpp          "echo %s is cpp source"  "echo %s it still is"
application/postscript  .ps           "PSView %s"
When starter is invoked with an argument, and the argument matches the mime-type and extension in an entry in this file, then the specified action(s) will be executed. If more than one argument was present, each argument will lead to a separate invocation of the action(s).

A single %s may be used in any of the action clauses. It will be replaced with the argument starter was invoked with.

Installation

To install starter, go to a shell and type

make

Then copy the executable starter from obj.x86 or obj.ppc to /home/config/bin . Furthermore, copy the sample starter.conf to /boot/home/config/settings. Edit starter.conf as needed.

Example

Suppose you have a script called PSView, and you have the example starter.conf file above. From a shell, typing

starter foo.ps
will cause the command:
PSView foo.ps

to be executed. Moreover, if the preferred application of foo.ps is set to be application/x-vnd.VL-starter, then double-clicking foo.ps from the desktop will cause PSView to be run on it.