#set TITLE = "i/o"
#include top

.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:

#include space

.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

#include space


.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
#set FILE = "#if"
#set TAG = "#if
#include link
,
#set FILE = "#for"
#set TAG = "#for
#include link
,
#set FILE = #include"
#set TAG = "#include
#include link
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


#include space2
.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

#include bottom
