write <channel> {,<message>}
Write text to a system output channel.
<channel>
A channel identifier.
<message>
One or more values in the form of an output list.
-del=<string>
Use <string>, a string value, as the delimiter between fields
on an output line. If this switch is omitted, the default channel
delimiter is used (channel.delimiter), or a space
if no channel delimiter has been set.
-fmt=<string>
Use <string> as a format specification for output field conversion.
The rules for the format string are those for C language "printf"
statements, although conversion types %c %n %p are not handled. If no
format switch is supplied, then the format associated with the channel
(channel.format) is used. If neither are valid,
then fields are output with the appropriate delimitation (using the value
from -del).
The write command may only be used on channels opened for writing, i.e. those opened with modes w, a and rw.
If there are no output list items, an empty line will be written to <channel>, otherwise each output list grouping will constitute one output line. A grouping is a list of items enclosed within hairpins.
There is no need to include LF characters (\n) at the end of the text lines to be written, because one will be appended automatically to each line.
If the channel is binary (opened by open -li=<port>, e.g. the FireRender output channel), the output will be wrapped in Fire Hose Protocol packet(s) of type NET_PACKET_STRING. If this command is being executed in response to a client request on the channel and precedes a writefile command, typically used to send a file back to a browser, the text being written will be regarded as an http header statement. See an example below.
Open a text file, and write 3 lines of data to it.
open ch,-of=myfile.txt write ch,'Line 1','Line 2','Line 3' ch.close
Write one line of data to an open channel.
write ch, <"X has a value",x>
Write one line of data with formatted numeric values
write ch, <x,y,z>, -fmt="%8.2f %g %10.4e"
Write some http header information to the FireRender channel, followed by some image output.
write firerender_channel, 'Content-Type: image/jpeg' write firerender_channel, 'Content-Disposition: inline; filename=example.jpg' writefile firerender_channel,example.jpg
Commands: |
|
Identifiers: |
chan# (channel), firerender_* |
Structures: |