Fileclose - Crestron SIMPL+ Reference Manual

Language reference guide
Hide thumbs Also See for SIMPL+:
Table of Contents

Advertisement

Software
®
122
SIMPL+

FileClose

Name:
FileClose
Syntax:
SIGNED_INTEGER FileClose (INTEGER handle)
Description:
Closes a file opened previously by FileOpen. You MUST close a file that was
opened, you won't be able to open it again, or eventually the control system may hang
or reboot. A reboot clears all open files. Files must be opened and closed during a
single thread of operation. Refer to "StartFileOperations()" on
Parameters:
HANDLE specifies the file handle of the previously opened file (from FileOpen).
Return Value:
Returns 0 if successful. Otherwise, file error code is returned.
Example:
(Refer to "File Functions Overview"on page 116)
SIGNED_INTEGER nFileHandle;
StartFileOperations();
nFileHandle = FileOpen ( "MyFile", _O_RDONLY );
IF (nFileHandle < 0)
{
PRINT("Error Opening File MyFile\n");
return;
}
IF ( nFileHandle > 0 )
{
IF ( FileClose ( nFileHandle ) <> 0 )
PRINT ( "Error closing file\n" );
}
EndFileOperations();
Version:
SIMPL+ Version 3.00.02 or higher (Pro 2 only)
Control System:
2-Series Only
Crestron SIMPL+
page
Language Reference Guide - DOC. 5797G
®
183.

Advertisement

Table of Contents
loading

Table of Contents