writefile <channel>, <file>
Write the contents of a file to a system output channel.
<channel>
A channel identifier.
<file>
The file whose contents are to be sent to the channel.
-k=<strings>
-t=<strings>
A set of keywords (-k) to be replaced by text values (-t). All occurrences of the keywords in <file> will be replaced by
corresponding text values as the file gets written. Keywords are indicated
in a file enclosed by $ and $.
These switches apply only
to the output of text files.
When written to a text channel, the file must be a text file. Writing a binary file to a text channel will have an undefined, and probably undesirable, result.
When written to a binary channel (e.g. the FireRender output channel), the file may be text or binary and the output will be wrapped in a Fire Hose Protocol packet of type NET_PACKET_FILE. When the ultimate recipient of the file is a browser, it is advisable to preface this command with a write command specifying the file type in an http header statement, see example below. This write + writefile sequence is typically done only once for each FireRender request.
Write a binary file.
writefile chan2, myfile.bin
Write an html file with keyword changes to the firerender channel, and ultimately a browser.
# Tell the browser it is an html file write firerender_channel,'Content-Type: text/html' writefile firerender_channel, myfile.htm, \ -k=<'host','port'>, \ -t=<'anchovy','3101'>
Commands: |
|
Identifiers: |
chan# (channel), firerender_* |