Extensions.File.WriteFile

From emotive
Jump to navigation Jump to search

Classification

Name WriteFile
Short Description Appends the given string to the text file
Class Action
Extension OTX File extension
Group File related Actions
Exceptions FileAccessException
FileFormatException
FileLockException
Checker Rules -
Standard Compliant Yes

OTL Syntax

File.WriteFile(FileWriteHandleTerm handle, StringTerm value);

Description

The WriteFile activity appends the given string to the text file specified in the file handle.

The first read or write activity on a file handle defines if an access shall be realized by line, bytes or file. Mixed access will lead to a FileFormatException.

Properties

Name Data Type Class Default Cardinality Description
Handle FileWriteHandle Term - [1..1] The handle for the file that the related file object encapsulates.
Value String Term - [1..1] The string to write to the file. The string can contain line breaks, which will be written without any operation system specific conversion.

OTL Examples

/// Local Declarations

File.FileWriteHandle FileWriteHandle1;

/// Flow

FileWriteHandle1 = File.OpenFileForWrite("file:///D:/abc/abc.txt", false, @Encoding:UTF-8);
File.WriteFile(FileWriteHandle1, "Hello\r\nWord");

See also

CloseFile
DeleteDirectory
DeleteFile
SaveFile
WriteBytes
WriteLine