Using external programs with Arachne


But why use an external program?


Arachne understands five basic file types: HTM, GIF, BMP, TXT and ASF.
If the file has a different extension than one of those and if in the conversion table in mime.cfg no corresponding action is defined, Arachne offers:
moving the downloaded file from the CACHE directory (or of a local file) to the DOWNLOAD directory... than you can do anything you want with that file.
You may even transport it to another computer.
(ASF files are treated as script files (simply lists of URLs).

A very often used format is .JPG, but only .GIF and .BMP can be inlined using the IMG-tag in HTML documents. Arachne uses some built in conversion programmes to view eg. .JPG images.
Such programmes have to be declared in mime.cfg!
JPG can be converted to BMP (Arachne default) or to GIF (my choice)... just change the declaration in mime.cfg


External »» internal

External programs can be placed into Arachne, making them internal progs.

Example

Texts generated by M$ WORD can not be viewed with Arachne, so we have to use a special program to view a WORD text (.doc) with DOS.

I use the DOS program: view.exe
View.exe is a small program that can be placed in the \Arachne directory. It can be automaticaly activated by Arachne on every occurence of the .doc extension by adding the following line to mime.cfg:

file/.doc   |@$view.exe $l ($l = letter "l" means last visited file)

This has a disadvantage...
If a .doc extension is encountered than view.exe is showing the file ;-) but you can not save the original word file with F2. However, you can find the original file in your cache and save it from there. This is not very practical...

If Arachne encounters an extension not declared in mime.cfg the "Arachne does not know how to handle following file type:" screen is showed. I modified this screen to have the opportunity to view a Word file and save the original. (The CACHE is not a save place to store any file.)
View.exe may save your file in .TXT format or even print it. See the change at the right: VIEW.EXE is added.

To change the "Arachne does not know.." page: just press F4 to edit the page if the page is on your monitor.

The <FORM ACTION="view.dgi"><INPUT TYPE="SUBMIT" VALUE="VIEW.EXE"> button should be added.

In the HTML tags for this button FORM ACTION is pointing to: view.dgi thus view.dgi has to be defined in mime.cfg. The file/.doc declaration, if already made, should be removed or altered into: file/view.dgi |@$view.exe $l
Now you can save and view your Word file.

Other example

In Arachne version 171.ue Glenn McCorkle introduced "ZBM". ZBM = Zipped BMP.
Since a BMP image is very large, to store and to send, the BMP is zipped before it is saved in order to make it much smaller.
The zipping is provoked by pressing F2 (save). An extra button is added to the "save screen" in the same way as already has been shown above.
The ZIP programs "PKZIP.exe" and "PKUNZIP.exe" (for viewing a ZBM) should be placed into Arachne. Also viewing and saving ZBM should be declared in mime.cfg.

Real external programmes


Example: Norton Commander

One of the programs I wanted to use is Norton Commander (NC) in the C:\NORTON directory.

Method #1

By pressing Alt E you are leaving Arachne and the return is by typing the DOS command EXIT. A simple way to use NC is:
Now you are in Norton Commander and can use it!

After you have done your things... press F10 [+ enter] to leave Norton
Now type: EXIT at the DOS prompt and you are back to Arachne... but not back at the point you left Arachne ;-((

Method #2

Alt E invokes 'dosshell.dgi'. I could not find a file or program called dosshell.dgi but in \system\dgi there is a batch file: dosshell.bat and some other programs like: fixmem.exe, wizard.exe, etc.
I suppose these progs execute within Arachne?

Why not make a batch file in \system\dgi that shells out to Norton commander? I called it 'norton.bat'.
Giving the command, the URL, file:norton.dgi does not start NC (to my surprise)... a dgi script has to be declared in mime.cfg first.
After adding the following line to mime.cfg it worked.

file/norton.dgi     |@call $esystem\\dgi\\norton.bat $e

Of course there is no hot key assigned to NC but:
* A HREF="norton.dgi" can be used in a HTML script
* With F3:
file:norton.dgi can be used
*
ShiftF10 file:norton.dgi in arachne.cfg makes Shift+F10 a hot key for NC
* The NC icon was added to the F10 Arachne "desk top" page

Now all was going well, except that after leaving NC there was no return to the place where I left Arachne. The push and pop commands were added to the batch file 'norton.bat' in the \system\dgi directory.
Now all is functioning the way I wanted it to.
[pop.com and push.com should be added to Arachne]

The batch file 'norton.bat'.

push
@echo off
C:\norton\nc
pop
EXIT

Although this might not be the easiest way to call an external program and return to Arachne, it works great!
My F2 button has been extended to call PICTURE VIEW as an external program too. PV can be used to view or convert (nearly) any image format into another... or print the image.


Arachne Package Manager

Another way of adding programmes to Arachne. See the Arachne HELP files, by pressing F1.
Now you schould be able to roll your own...
Regards, Bastiaan
This file: ext-prog.htm also used: savetrix.gif