.ig >>
<STYLE TYPE="text/css">
<!--
        A:link{text-decoration:none}
        A:visited{text-decoration:none}
        A:active{text-decoration:none}
        OL,UL,P,BODY,TD,TR,TH,FORM { font-family: arial,helvetica,sans-serif;; font-size:small; color: #333333; }

        H1 { font-size: x-large; font-family: arial,helvetica,sans-serif; }
        H2 { font-size: large; font-family: arial,helvetica,sans-serif; }
        H3 { font-size: medium; font-family: arial,helvetica,sans-serif; }
        H4 { font-size: small; font-family: arial,helvetica,sans-serif; }
-->
</STYLE>
<title>quisp: i/o</title>
<body bgcolor=99cc99 vlink=0000FF>
<br>
<br>
<center>
<table cellpadding=2 bgcolor=FFFFFF width=550 ><tr>
<td align=right><a href="quisp_home.html">
<img src="img/quisp2.gif" border=0><br><small>quick server pages</a> &nbsp; &nbsp; </td></tr>
<td>
.>>

.TH i/o TDH "01-JUN-2005   TDH scg@jax.org" 

.SH Input / output
With QUISP, any line that is not a directive or a comment is output directly.
Hence, most template output is done without any kind of "print" statement.
There are, however, several output-related directives for handling special situations:

.ig >>
<br><br><br>
.>>

.SH #+ 
As mentioned above, any line that is not a directive or a comment is output directly by QUISP.
However, it is often desirable to indent code to express nest levels.
Leading space is normally skipped over in HTML, so the indent is not really a concern there.
But for other situations
where the leading space will present a problem, the \fC#+\fR output directive is provided.
All content following the \fC#+ \fR (less one space) is written to standard output.
.LP
Example: \fC#+ hello world\fR

.ig >>
<br><br><br>
.>>


.SH #write - #endwrite
Write \fItext\fR to \fIfile\fR, such as to add an entry to a log.
\fIpathname\fR should be a full pathname.
\fIfilemode\fR is either \fCw\fR to create, or \fCa\fR to append.
\fItext\fR may be any number of lines, and other directives, such as
.ig >>
<a href="#if">
.>>
\0#if
.ig >>
</a>
.>>
,
.ig >>
<a href="#for">
.>>
\0#for
.ig >>
</a>
.>>
,
.ig >>
<a href="#include@_SL01">
.>>
\0#include
.ig >>
</a>
.>>
and so on may be embedded to help generate the text.
When the \fC#endwrite\fR is encountered, the file is closed.
.LP
Usage:
\fC#write  \fIpathname\fC  [\fIfilemode\fR]
.br
\0..\fItext\fR..
.br
\fC#endwrite\fR 
.LP
Hint: use \fC@PROJDIR\fR to represent the pathname of the project directory.
.LP
Security concern: user-supplied values (such as CGI user variables) should not be used 
to build the pathname, unless
proper measures are taken to detect and remove the \fC../\fR construct (used as a hack 
to see higher levels of the file system).
.LP
Example: the following code will log page hits with date,
time, name of page, and the HTTP info.
.LP
.nf
\0#set RH = $getenv(REMOTE_HOST)
\0#set RF = $getenv(HTTP_REFERER)
\0#call $setdatefmt(yyyy/mmm/dd)
\0#set DATE = $todaysdate()
\0#set TIME = $time()
\0#write @PROJDIR/logs/usage_log a
\0@DATE @TIME @rtn @RH @RF
\0#endwrite
.fi


.ig >>
<br><br>
.>>
.SH #cat
.LP
Copy the contents of \fIfile\fRs to the standard output.
No processing or interpretation is done to the contents.
Suitable for text files or binary files.
.LP
Security concern: user-supplied values (such as CGI user variables) should not be used to build filenames, unless
proper measures are taken to detect and remove the \fC../\fR construct (used as a hack 
to see higher levels of the file system).
.LP
Usage: \fC#cat  \fIfile1\fR [..\fIfileN\fR]
.LP
Example: \fC#cat /home/scg/img/banner.gif\fR

.ig >>
<br>
<br>
</td></tr>
<td align=right>
<a href="quisp_home.html">
<img src="img/quisp2.gif" border=0></a><br>
<small>quick server pages &nbsp; &nbsp;<br>
<a href="Copyright.html">Copyright Steve Grubb</a> &nbsp; &nbsp;
</td></tr>
</table>
.>>
