Moai SDK  1.5 revision 1 (MoaiEdition)
MOAIFileSystem Class Reference

Inherits MOAIGlobalClass< TYPE, SUPER >, and MOAIGlobalClass< TYPE, SUPER >.

List of all members.

Function List

  affirmPath
  checkFileExists
  checkPathExists
  copy
  deleteDirectory
  deleteFile
  getAbsoluteFilePath
  getAbsoluteDirectoryPath
  getRelativePath
  getWorkingDirectory
  listDirectories
  listFiles
  mountVirtualDirectory
  rename
  setWorkingDirectory

Function Documentation

Creates a folder at 'path' if none exists.


function affirmPath ( string path )
Parameters:
path ( string )
Returns:
nil

Check for the existence of a file.


function checkFileExists ( string filename )
Parameters:
filename ( string )
Returns:
exists ( boolean )

Check for the existence of a path.


function checkPathExists ( string path )
Parameters:
path ( string )
Returns:
exists ( boolean )

Copy a file or directory to a new location.


function copy ( string srcPath, string destPath )
Parameters:
srcPath ( string )
destPath ( string )
Returns:
result ( boolean )

Deletes a directory and all of its contents.


function deleteDirectory ( string path [, boolean recursive ] )
Parameters:
path ( string )
recursive ( boolean ) Optional. If true, the directory and all contents beneath it will be purged. Otherwise, the directory will only be removed if empty.
Returns:
success ( boolean )

Deletes a file.


function deleteFile ( string filename )
Parameters:
filename ( string )
Returns:
success ( boolean )

Returns the absolute path given a relative path.


function getAbsoluteDirectoryPath ( string path )
Parameters:
path ( string )
Returns:
absolute ( string )

Returns the absolute path to a file. Result includes the file name.


function getAbsoluteFilePath ( string filename )
Parameters:
filename ( string )
Returns:
absolute ( string )

Given an absolute path returns the relative path in relation to the current working directory.


function getRelativePath ( string path )
Parameters:
path ( string )
Returns:
path- ( string )

Returns the path to current working directory.


function getWorkingDirectory ()
Returns:
path ( string )

Lists the sub-directories contained in a directory.


function listDirectories ( [ string path ] )
Parameters:
path ( string ) Optional. Path to search. Default is current directory.
Returns:
diresctories ( table )

Lists the files contained in a directory.


function listFiles ( [ string path ] )
Parameters:
path ( string ) Optional. Path to search. Default is current directory.
Returns:
files ( table )

Mount an archive as a virtual filesystem directory.


function mountVirtualDirectory ( string path [, string archive ] )
Parameters:
path ( string ) Virtual path.
archive ( string ) Optional. Name of archive file to mount. Default value is nil.
Returns:
success ( boolean )

Renames a file or folder.


function rename ( string oldPath, string newPath )
Parameters:
oldPath ( string )
newPath ( string )
Returns:
success ( boolean )

Sets the current working directory.


function setWorkingDirectory ( string path )
Parameters:
path ( string )
Returns:
success ( boolean )