User Guide

58 CFML Language Reference
CFFILE ACTION="Append"
Use CFFILE with the Append action to append additional text to the end of an existing
text file, for example, when creating log files.
Syntax <CFFILE ACTION="Append"
FILE="full_path_name"
OUTPUT="string"
ATTRIBUTES="file_attributes">
FILE
Required. The full path name of the file to which the content of the OUTPUT
attribute is appended.
OUTPUT
Required. The string to be appended to the file designated in the DESTINATION
attribute.
ADDNEWLINE
Optional. Yes or No. If this attribute is set to Yes, a new line character is appended
to the text that is written to the file. If this attribute is set to No, no new line
character is appended to the text. The default value is Yes.
ATTRIBUTES
Optional. A comma-delimited list of file attributes to be set on the file being
appended. The following file attributes are supported:
ReadOnly
Temporary
Archive
Hidden
System
Normal
If ATTRIBUTES is not used, the file’s attributes are maintained. If Normal is
specified as well as any other attributes, Normal is overridden by whatever other
attribute is specified.
Individual attributes must be specified explicitly. For example, if you specify just
the ReadOnly attribute, all other existing attributes are overwritten.
Example The following example appends the text string "But Davis Square is the place to be. " to
the file
fieldwork.txt which was created in the previous example:
<CFFILE ACTION="Append"
FILE="c:\files\updates\fieldwork.txt"
OUTPUT="<B>But Davis Square is the place to be.</B>">