Murl Engine Lua Addon API  Version 1.0 beta
Murl.IFile

The file interface provides access to a single file.

The IFile object can be created by the IFileInterface object.


Table members

Methods


GetPosition()

Get the position of the file pointer. Read() / Write() operations start at the file pointer position, the default position is zero.

Integer GetPosition()

Returns
Integer The position of the file pointer in bytes.

SetPosition(position)

Set the position of the file pointer. Read() / Write() operations start at the file pointer position, the default position is zero.

SetPosition(Integer position)

Parameters
positionThe position of the file pointer in bytes.

GetSize()

Get the size of the file.

Integer GetSize()

Returns
Integer The size of the file in bytes.

Read(data)

Read from the file at the current file pointer position. The size of the data object's data is the number of bytes to read, if the data object is empty the data is resized to GetSize().

Integer, Murl.Data Read(Murl.Data data)

Parameters
dataThe data object to read the file into.
Returns
Integer The number of bytes read into the data object.
Murl.Data data The data object to read the file into.

Write(data)

Write to the file at the current file pointer position.

Integer Write(Murl.ConstData data)

Parameters
dataThe data object to write into the file.
Returns
Integer The number of bytes written into the file.