Spec-Zone.ru › ColdFusion

fileAppend

Appends the data contents to the file.

fileAppend(file, data [, charset] [, addNewLine]) → returns void

  • CF
  • Lucee
  • BL 1.0.0+
  • See Also: filewrite

    Argument Reference

    file string
    Required

    File path

    data string
    Required

    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

    Compatibility

    ColdFusion:

    Prior to CF2016u11 and CF2018u4, charset param was required.

    Examples
    Sample code invoking the fileAppend function

    Simple Example

    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);

    © 2012–present Foundeo, Inc. and the CFDocs contributors.
    Licensed under the MIT License.
    ColdFusion is a trademark of Adobe Systems Incorporated.
    https://cfdocs.org/fileappend

    Spec-Zone.ru

    Настройки Оффлайн Что нового Помощь О нас
    Spec-Zone .ru
    спецификации, руководства, описания, API