Function group Execute on client Platform(s)
FileOps NO All




Reads data from the open file associated with the object. Binary xVariable receives the data read from the file. Returns kTrue for success

You are recommended to use $readcharacter() to read character data, otherwise you may get unexpected results. 

If you omit iStartPos and iLength, $readfile() reads all the remaining data from the current position to the end of the file; you can set the current position using the function $setposition(). Otherwise, you can specify the position from where the data is to be read, using the iStartPos parameter, and you can specify the number of bytes to read using the iLength parameter. iLength must not exceed the data available from iStartPos to the end of the file. 

$readfile() returns a boolean value, which is true if the data was successfully read. After reading the data, the current position addresses the byte after the last byte read, or end of file, if no further data remains.