beautypg.com

Roreadwritefile – BrightSign Object Reference Manual (FW 5.1) User Manual

Page 136

background image

128

roReadWriteFile

The object opens a file and allows both reading and writing operations on that file.

Object Creation: Creating an roReadWriteFile object opens an existing file for both reading and writing. Object creation
fails if the file does not exist. The current position is set to the beginning of the file.

CreateObject("roReadWriteFile", filename As String)

Interfaces:

ifReadStream

,

ifStreamSend

,

ifStreamSeek


The ifReadStream interface provides the following:

SetReceiveEol(eol_sequence As String) As Void: Sets the EOL sequence when reading from the
stream.

ReadByte() As Integer: Reads a single byte from the stream, blocking if necessary. If the EOF is reached or
there is an error condition, then a value less than 0 is returned.

ReadByteIfAvailable() As Integer: Reads a single byte from the stream if one is available. If no bytes are
available, it returns immediately. A return value less than 0 indicates either that the EOF has been reached or no
byte is available.

ReadLine() As String: Reads until it finds a complete end of the line sequence. If it fails to find the sequence
within 4096 bytes, then it returns the 4096 bytes that are found. No data is discarded in this case.

ReadBlock(size As Integer) As String: Reads the specified number of bytes. The number is limited to
65536 bytes. In the event of an EOF or an error, fewer bytes than requested will be returned. Any null bytes in the
file will mask any further bytes.

AtEof() As Boolean: Returns True if an attempt has been made to read beyond the end of the file. If the
current position is at the end of the file, but no attempt has been made to read beyond it, this method will return
False.