Fileseek - Crestron SIMPL+ Reference Manual

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

Advertisement

Crestron SIMPL+
Language Reference Guide - DOC. 5797G
®

FileSeek

Name:
FileSeek
Syntax:
SIGNED_INTEGER FileSeek (INTEGER handle, LONG_INTEGER
offset, INTEGER origin )
Description:
Positions the current file pointer.
Parameters:
HANDLE specifies the file handle of previously opened file (from FileOpen).
OFFSET specifies the number of bytes to move relative to the origin.
ORIGIN is on of the file seek flags in the following table.
FileSeek Flags:
KEYWORD
SEEK_SET
SEEK_CUR
SEEK_END
Return Value:
Number of bytes offset from the beginning of file. Otherwise, file error code is
returned.
Example:
(Refer to "File Functions Overview"on page 116)
SIGNED_INTEGER
StartFileOperations();
nFileHandle = FileOpen("MyFile", _O_RDONLY);
IF (nFileHandle >= 0)
{
IF (FileSeek( nFileHandle, 0, SEEK_SET)) < 0 )
PRINT ( "Error seeking file\n" );
IF ( FileClose ( nFileHandle ) <> 0 )
PRINT ( "Error closing file\n" );
EndFileOperations();
}
FUNCTION
Start seeking from beginning of file
Start seeking from current position in file
Start seeking from end of file
nFileHandle;
Software
®
SIMPL+
143

Advertisement

Table of Contents
loading

Table of Contents