Murl Engine Lua Addon API  Version 1.0 beta
Murl.System.File

The system file access class.


Table members

Functions


Murl.System.File.GetFiles(path)

Get all file names from a specified path.

Murl.Array.String GetFiles(String path)

Parameters
pathThe path to examine the files.
Returns
Murl.Array.String A string array containing all files names.

Murl.System.File.FileExists(path)

Check if a file exists.

Boolean FileExists(String path)

Parameters
pathThe path and filename.
Returns
Boolean true if the file exists.

Murl.System.File.DeleteFile(path)

Delete a file.

Boolean DeleteFile(String path)

Parameters
pathThe path to the file to delete.
Returns
Boolean true if successful.

Murl.System.File.MoveFile(oldPath, newPath)

Move/rename a file.

Boolean MoveFile(String oldPath, String newPath)

Parameters
oldPathThe current path to the file to move.
newPathThe new path of the file.
Returns
Boolean true if successful.

Murl.System.File.GetFileSize(path)

Get the size of a file in bytes.

Integer GetFileSize(String path)

Parameters
pathThe path to the file to check.
Returns
Integer The file's size in bytes.

Murl.System.File.GetFolders(path)

Get all folder names from a specified path.

Murl.Array.String GetFolders(String path)

Parameters
pathThe path to examine the folders.
Returns
Murl.Array.String A string array containing all folder names.

Murl.System.File.FolderExists(path)

Check if a folder exists.

Boolean FolderExists(String path)

Parameters
pathThe path and the folder.
Returns
Boolean true if the folder exists.

Murl.System.File.CreateFolder(path)

Create a folder.

Boolean CreateFolder(String path)

Parameters
pathThe path and the folder to create.
Returns
Boolean true if successful.

Murl.System.File.DeleteFolder(path, recursively)

Delete a folder.

Boolean DeleteFolder(String path, Boolean recursively)

Parameters
pathThe path and the folder to delete.
recursivelyIf true, the folder and all contents are deleted. If false, the function fails when the folder is not empty.
Returns
Boolean true if successful.

Murl.System.File.MoveFolder(oldPath, newPath)

Move/rename a folder.

Boolean MoveFolder(String oldPath, String newPath)

Parameters
oldPathThe current path to the folder to move.
newPathThe new path of the folder.
Returns
Boolean true if successful.

Murl.System.File.GetItemCreationTime(path, time)

Get the creation time of a file or folder.

Boolean, Murl.System.Time GetItemCreationTime(String path, Murl.System.Time time)

Parameters
pathThe path to the file or folder to query.
timeA reference to a time object to receive the creation time.
Returns
Boolean true if successful.
Murl.System.Time time A reference to a time object to receive the creation time.

Murl.System.File.GetItemModificationTime(path, time)

Get the time a file or folder was most recently modified.

Boolean, Murl.System.Time GetItemModificationTime(String path, Murl.System.Time time)

Parameters
pathThe path to the file or folder to query.
timeA reference to a time object to receive the last modification time.
Returns
Boolean true if successful.
Murl.System.Time time A reference to a time object to receive the last modification time.

Murl.System.File.new()

The default constructor.

Murl.System.File new()

Returns
Murl.System.File


Methods


Open(fileName, mode)

Open a file.

Boolean Open(String fileName, Murl.IEnums.FileAccessMode mode)

Parameters
fileNameThe file name to open.
modeThe access mode for opening the file.
Returns
Boolean true if successful.

Close()

Close the file.

Boolean Close()

Returns
Boolean true if successful.

IsOpen()

Check if the file is open.

Boolean IsOpen()

Returns
Boolean true if the file is open.

GetSize()

Get the size of the file.

Integer GetSize()

Returns
Integer The byte size of the file.

GetPosition()

Get the file pointer position.

Integer GetPosition()

Returns
Integer The file pointer position in bytes.

SetPosition(position)

Set the file pointer position.

SetPosition(Integer position)

Parameters
positionThe file pointer position in bytes.