cffile action = "append"

Description

Appends text to the end of an existing text file; for example, when creating log files.

Category

File management tags

Syntax

<cffile action = "append"
  file = "full_path_name"
  output = "string"
  attributes = "file_attributes"> 

See also

cfdirectory

Attributes

Attribute
Description
file
Required. The full pathname 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 Yes, a new line character is appended to the text that is written to the file. If 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 written. 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 with any other attributes, normal is overridden by whatever other attribute is specified.
Individual attributes must be specified explicitly. For example, if you specify only 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>">