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

Saves and closes the current file. More...

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

Public Attributes

FileHandleVariable handle
 The handle for the file that the related file object encapsulates. More...
 
- Public Attributes inherited from OpenTestSystem.Otx.Core.Actions.ActionRealisation
OtxLink validFor
 Validity of ActionRealisation. More...
 

Detailed Description

Saves and closes the current file.

The CloseFile activity saves and closes the current file and releases any resources associated with the current file. The use of CloseFile is optional. If the file handle goes out of scope, it is automatically closed.

If a diagnostic sequence uses a FileHandle after it has been closed by a CloseFile action, the runtime system shall throw an otx:InvalidReferenceException.

Exceptions
Exceptions.FileSaveException
Core.Exceptions.InvalidReferenceException


Syntax
File.CloseFile(FileHandleVariable handle);
FileHandleVariable handle
The handle for the file that the related file object encapsulates.
Definition: File.cs:833
Examples
// Local Declarations
File.FileReadHandle FileReadHandle;
// Flow
FileReadHandle = File.OpenFileForRead("file:///D:/abc.txt", @Encoding:UTF-8);
File.CloseFile(FileReadHandle);

Member Data Documentation

◆ handle

FileHandleVariable OpenTestSystem.Otx.Extensions.File.Actions.CloseFile.handle

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