The Arachne Minimalist -
Vol 2 Num 4
Clarence Verge ( )
Přečteno 157896x, 28 komentářů, rubrika: (en) Archive
Finally a working email address + The long awaited Secrets of MIME.cfg.
Some may say there are no secrets -it's all obvious. But when I tried
to gain an understanding of MIME.cfg a couple of years ago, help was not
available anywhere. Now, with the aid of source code and experience and
mostly experiment, I think I know what's going on.
I had forgotten until recently that others were not with me on that path
and may benefit if I try to share the experience.
To start with, I want to point you to an alternate source of information
presented in a different style. "Secrets of Mime.cfg" is a phrase I came
up with a couple of years ago when this page did not exist.
Archived email available. <G> :
MIME.cfg serves four purposes. It contains the information that tells
Arachne how to treat the different mime types such as text/plain,
image/gif, audio/x-wav, application/zip, etc. specified by the server
(sometimes incorrectly) for each file at download time.
It contains a list of file extensions which Arachne will recognize and use
when asked to save a file - otherwise NO extension is saved.
It contains action instructions, sometimes complex, which Arachne will
follow based on extensions found for files accessed locally.
Finally, it contains detailed action instructions for Arachne to execute
when these are called by her own internal or custom pages.
Check out the syntax rules at the end of MIME.cfg and don't worry about
what each variable MIGHT expand to. I will show you how to see what they
WILL expand to.
Now the first secret: What I personally had the most trouble understanding
was the format of a .DGI line. What program interpreted these lines ?
How can I make any sense of the syntax ? What part of the line goes to DOS,
if any ?
Core interprets the line. Unfortunately, core expects to see standard DOS
re-direction and piping symbols as switch symbols for itself at the first
part of the line. Once core has determined that all its switchs have been
interpreted, it ignores the remainder of the line and passes it to DOS.
I would like to say that the "|" symbol divides the line into: left part
for core and right part for DOS, but this isn't quite true. The "@" symbol
and numbers enclosed by "[ ]" are also in core territory.
But everything to the right of these symbols is expanded and passed to
DOS either as single or multiple command lines !
The second secret: To the left of the "|" divider you may frequently see
something like ">BMP", ">HTM" (or other) that seems to imply that a BMP
or HTML file will be created. Nothing could be further from the truth.
Nothing is created or converted. Only a file EXTENSION is controlled.
Arachne will place the first three characters found between ">" and "|"
in the extension position of the proposed output filename.($2) If there
is nothing specified, there will be no extension. If the extension isn't
present as a file type in MIME.cfg, Arachne won't know what to do later
when she arrives at the read-in and interpretation phase.
The next secret: The replaceable parameters used as shorthand on the DOS
side of the line don't expand to exactly what you might think, if you
think like me. In fact, they expand differently for different versions
of Arachne. To see what you may have to deal with when writing your
own .DGIs, you can try THIS
to display selected parameters.
You will find that $s and $q don't contain the same information, and there
may be unexpected characters included in the query string. To clean up the
contents of $q for general use I created QFIX.com.
Simply use it at the front of your .DGI in this manner:
Extend the line as desired. By the way, the "CGI compatible query string"
is the contents of your input form. This was another secret to me.
Have fun. 8-)
Formátovat pro tiskVšechny články tohoto autora Všechny články v rubrice (en) Archive