Arachne mime.cfg secrets
Arachne understands five basic file types: HTM, GIF, BMP, IKN and TXT.
Only GIF, IKN and BMP can be inlined using <IMG> tag.
If the file has different extension than these and in the following conversion table there's no corresponding action defined, Arachne offers moving of downloaded file from CACHE directory (or of local file) to DOWNLOAD directory.
IKN, HTM, TXT and GIF is hardcoded into Arachne, and it can't be changed by external programs.
For conversion to supported format the macro "extension1>extension2|command" is used.
For calling external viewer macro "extension|command" is used.
"extension|command>$2" is used for converting into HTML if the program prints to the screen (must use stdout).
Syntax of MIME.CFG
A command starts with one of the following:
- @ ... execution is in text mode and with maximum memory
- [nn] ... execution is made without temporary leaving of Arachne if there is nn + 10 KB available memmory.
- If nothing is specified then the program will be executed after temporary leaving Arachne.
In command arguments you can use following macros.
Instead of $1, $2, etc. (as Unix scripts has) you can use %1, %2 (as DOS batch files has).
These are in some sort of alpabetical order to make it easier to see what each one does.
|$1||Full input filename||The file Arachne is trying to "launch"
|$2||Full output filename||The file where Arachne should write to (in cache)|
Used for internal purposes by Arachne.
Should be added to all commands that convert something to a known format.
|$a||Path to cache||Typicaly CACHE\
|$b||Full name of bookmarks||Typicaly HOTLIST.HTM
|$c||Full name of cache index||Typicaly CACHE.IDX
|$d||File||ftp://ftp.vse.cz/pub/msdos/Arachne/ -> /pub/msdos/Arachne/
|$e||Path to executable files||The directory where CORE.EXE, INSIGHT.EXE, etc is located
|$g||IP address of first gateway||According to ARACHNE.CFG
|$h||Full name of history file||Typicaly HISTORY.LST
|$i||Your IP address||
|$l||Last visited document||Filename (ex. home.htm)
|$m||Path to mail directory||Typicaly MAIL\
|$n||IP address of first nameserver||According to ARACHNE.CFG
|$p||Host||telnet://cyberspace.org -> cyberspace.org
|$q||File with query string||created only when using this macro
|$r||Screen resolution||(639, 799 or 1023)
|$s||CGI compatible query string||Max. 80 characters
|$t||Path for temporary files||(either CACHE\ or %TEMP% - see Cache2TEMP)
|$u||URL of document||Ex. file://c:/arachne/home.htm
|$w||Download path||(typicaly DOWNLOAD\)
|$x||Netmask||According to ARACHNE.CFG
|\n||End of line||This won't work for "|[nn]" style commands
|%%||% character||If you need a % in the command
|$$||$ character||If you need a $ in the command
|\\||\ character||Usefull if you need to specify directories
Examples of use in mime.cfg
Comments before we start
You can leave out the spaces in the commands if you want too, but they will be harder to read so I will not do like that.
You can type the commands in either in lower or UPPER case (atleast in the DOS version).
To be able to read .1st files off-line
Add the line file/.1st TXT
file/ specifies that it's for off-line mode.
.1st that it's for files with the extemsion .1st (or *.1st if you prefer that)
TXT specifies what Arachne should interpret the file as.
Let's say you have a program that converts a .1st file to a .htm file
(No I don't have one so I can't mail it to you.)
Add the line file/.1st > HTM|1st2htm.exe $1 > $2
file/ and .1st was explained earlier.
But what does the '>' mean? Is it a redirection (as in the DOS command type file.txt > file2.txt or Linux cat file.txt > file2.txt).
No it isn't, it's a was to let Arachne know that it should convert .1st files into the next word.
HTM Specifies the type that .1st should be read as (just as it earlier was read as TXT). Do not use something that isn't declared in mime.cfg (ex. XYZ isn't declared).
'|' means that the command starts afterwards.
1st2htm.exe is the name of the program that is launched.
$1Tells 1st2htm.exe the name of the file.
This '>' is a "normal" one and is part of the command.
$2 is the name of the cache file.
The program must write to stdout (if you aren't a programmer it means that it must write to the screen - but not use some "smart" way to do that.)
What if the program doesn't write to stdout but to a file?
Change the line to file/.1st 1ST>HTM|1st2htm $1 $2
1ST>HTM shows that the output will be a file that was declared earlier as HTM.
Since $2 isn't redirected this time the program takes it as it's second parameter and writes to it.
What you should be aware off
If you declare ex. file/.c all others that start with 'c' must come before that line in mime.cfg
Every mime type declared (file/ isn't a standard mime type) will save that file with the correct extension.
$2 name is always set by Arachne internally and you can't change more then the extension (by selecting what extension it should have).
You MUST use '\\' to get a '\' if you need to write directory statments (ex: c:\\dos\\edit.com)
Remove all commented lines (those starting with ';')
Switch positions so the items most often used are at the top (APM added lines are always last if they don't change a previous setting).
This file was made by Bernhard "Bernie" Eriksson by using some of the information from (at-least older) mime.cfg, information from Michael Polak and several hours of experimenting with the file ;)
This document is always under construction, last change: 99-05-31
© Bernhard "Bernie" Eriksson 1999, 2006.