The READFILE tag offers access to textual data files. The tag does not support
absolute or '..' (parent) directory access. With this tag, files can only be
read in the script directory. For security reasons, this is by design. The LINES
attribute allows the data to be read from a regular text file, and stored to a
named LIST object (one text line per element).
Note: READFILE supports "virtual" paths. These paths can be configured
by the system administrator.
Attributes:
NAME
variable to receive (textual) file data
FILE
file to access (relative to current directory or a virtual directory)
LOCK
lock file during read? "yes" or "no" ("no" by default)
LINES
is text file a list of lines? "yes" or "no" ("no" by default)
<!--- Write out the new data file --->
<SAWRITEFILE FILE="GuestBook.htm" ACTION="CREATE">
#entry#
</SAWRITEFILE>
<!--- Read file and create a list with lines ---> <SAREADFILE FILE="SomeDir\SomeFile.dat" NAME=lines LINES="yes">
<!--- Write out the data with line #'s --->
<SAWRITEFILE FILE="SomeDir\SomeFile.dat">
<SALOOP FROM=0 TO=entry.Length() NAME=count>
Line:#count+1# #entry#</SALOOP>
</SAWRITEFILE>