Appends the data contents to the file.

fileAppend(filePath, data [, charset]) → returns void

fileAppend Argument Reference

filePath string

File path

data string

Data to append to the file

charset string

The character encoding in which the file contents is encoded.

addNewLine boolean
Default: true

CF2016u11+ Indicates whether a new line is added to the end of the appended data



Prior to CF2016u11 and CF2018u4, charset param was required.

Examples sample code invoking the fileAppend function

Appends a mock entry to a file.

// Create mock log entry
logEntry = dateTimeFormat(now(), "yyyy/mm/dd HH:nn") & " this is a mock log entry!";

// Append line to file
fileAppend("/path/to/file.log", logEntry);

Fork me on GitHub