Fileno – Visara Master Console Center Scripting Guide User Manual
Page 106

Chapter 5 Script Commands
Scripting Guide
106
FILENO
Syntax
FILENO(%FileHandle) ==> %FileDescriptor
Description:
Obtains the system integer file descriptor from a file handle.
Action:
Obtains the system integer descriptor from the given file handle. Some
external system calls require the descriptor instead of a handle so this
is most useful in interfacing with shell scripts.
Parameters:
%FileHandle: Numeric expression. The file handle obtained from
FOPEN.
Returns:
Numeric value, as follows:
-1 = Error occurred (not a valid file handle)
Any other value = The system file descriptor.
Example:
%fd := FILENO(%handle)
IF ( %tmpfile == -1 )
LOG( LOG_FLT, STR(%handle) + " is not a valid file
handle!", 6)
ELSE
LOG( LOG_FLT, "Descriptor is " + STR(%fd), 6)
ENDIF
See Also:
FOPEN, FREAD, FWRITE, FCLOSE, MKSTEMP