Skip to content

Append_Output

Include: Use System\FileSystem.pkg

See Also: Direct_Output, Close_Output, Flush_Output, Write, Write_Line, Seq_New_Channel, Seq_Release_Channel, Sequential Channels

Purpose

Opens a sequential output file and appends new output to the end.

Syntax

Append_Output [Channel {ChannelNumber}] {FileName}
Append_Output [Channel {ChannelNumber}] FILE {FileName}

Arguments

Channel {ChannelNumber} : Optional channel selector. Use Seq_New_Channel when opening files in application code; see Sequential Channels.

FILE : Optional file driver. When omitted, Append_Output uses FILE.

{FileName} : The file to open. If the file exists, new output is written after the existing contents. If it does not exist, it is created.

Example

Handle hFile

Get Seq_New_Channel to hFile
Append_Output Channel hFile "test1.txt"
Write_Line Channel hFile "Appended line"
Close_Output Channel hFile
Send Seq_Release_Channel hFile

Existing contents in test1.txt remain before the appended line.

Advanced: file-name options

Append_Output accepts the same file-name options as Direct_Output. Default file handling is binary-style with LF line endings; binary: is accepted but does not change that default, and pc-text: opts into CR/LF line handling.