File Open
Last updated
Last updated
FileOpen keeps a file open to speed up a large number of write operations.
This function creates a FileHandle object in its execution path that can be used by the or functions to write to the opened file.
You can also use the function to assign values to the FileHandle's 'Append' property to add content that way. See the below.
The full path to the file that has to be kept open for writing.
Indicates if the file to open (or create) is a text file.
Only displayed if the Is Text property option is checked.
Selects the character encoding to use when writing text to the file.
The default Codepage is the one used in your operating system.
You can opt to create the file or return an error if the file already exists.
Only displayed if the Is Text property option is checked.
Specifies what to do if the file already exists.
Options:
Append Data: Any text that is written to the file is added to the end of the file.
Increment File Name: Adds a number to the file name to make it unique, starting with 1.
Overwrite File: Replaces all content in the file with the new content.
Throw Exception: Stops the function's processing and returns an error.
Suppose you have a long list of lines of text to write to a file. Using the FileOpen function, as shown below, will run much quicker than doing it without the FileOpen function.
Set the 'File path' property of the TextFileWrite function to FileOpen.File.FileHandle
.
Set the 'Target' property of the SetValue function to FileOpen.File.FileHandle.Append
or FileOpen.File.FileHandle.AppendLine
. 'AppendLine' will add a line terminator after the text.