Thunderstone Software Document Search, Retrieval, and Management
Search:
Vortex Manual
 

WRITE - write to file

 

SYNOPSIS

<WRITE [APPEND] $file>
  ... output to file ...
</WRITE>


DESCRIPTION
The WRITE statement redirects the output generated inside its block to the given $file, truncating if it exists. If the APPEND flag is given, the file is appended to instead of truncated.

In version 4.00.1004670000 20011101 and later, the $file argument may be an empty string for output to be discarded (i.e. /dev/null or NUL redirect); "-" (single dash) to denote stdout (i.e. no-op); or "--" (two dashes) to denote top-level stdout (i.e. "break through" all outer <CAPTURE>, <WRITE> etc. and print to output).


DIAGNOSTICS
WRITE has no effect on $ret.


EXAMPLE
This function appends a log message ($logmsg) to a log file:

<A NAME=logmsg>
  <WRITE APPEND /tmp/log.txt>
    <fmt "%t %s\n" "now" $logmsg>
  </WRITE>
</A>


CAVEATS
The WRITE statement was added in version 2.1.901600000 19980728.

While the output of WRITE is buffered, simultaneous writes to the same file by different processes is discouraged, as there is no guarantee any process's data will be completely written before the others'.


SEE ALSO
read, READLN


Copyright © Thunderstone Software     Last updated: Thu Dec 22 15:13:31 EST 2011
 
Home   ::   Products   ::   Solutions   ::   How to Buy   ::   Support   ::   Contact Us   ::   News   ::   About
Copyright © 2012 Thunderstone Software LLC. All rights reserved.