OTX Reference  
OpenTestSystem.Otx.Extensions.File.Actions.WriteFile Class Reference

Writes all lines of a text file specified in the file handle. More...

Inheritance diagram for OpenTestSystem.Otx.Extensions.File.Actions.WriteFile:
Inheritance graph

Public Attributes

FileWriteHandleTerm handle
 The handle for the file that the related file object encapsulates. More...
 
StringTerm value
 The string to write to the file. The string can contain line breaks. More...
 
- Public Attributes inherited from OpenTestSystem.Otx.Core.Actions.ActionRealisation
OtxLink validFor
 Validity of ActionRealisation. More...
 

Detailed Description

Writes all lines of a text file specified in the file handle.

The WriteFile activity writes all lines of a text file specified in the file handle. Subsequent calls to WriteFile on the same handle will re-write the contents of the file.

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.

Exceptions
Exceptions.FileAccessException
Exceptions.FileFormatException
Exceptions.FileLockException


Syntax
File.WriteFile(FileWriteHandleTerm handle, StringTerm value);
FileWriteHandleTerm handle
The handle for the file that the related file object encapsulates.
Definition: File.cs:496
StringTerm value
The string to write to the file. The string can contain line breaks.
Definition: File.cs:506
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");

Member Data Documentation

◆ handle

FileWriteHandleTerm OpenTestSystem.Otx.Extensions.File.Actions.WriteFile.handle

The handle for the file that the related file object encapsulates.

◆ value

StringTerm OpenTestSystem.Otx.Extensions.File.Actions.WriteFile.value

The string to write to the file. The string can contain line breaks.