FileDelete: Difference between revisions
Jump to navigation
Jump to search
m (Needs example) |
No edit summary |
||
Line 5: | Line 5: | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
bool fileDelete ( string | bool fileDelete ( string filePath ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
===Required Arguments=== | ===Required Arguments=== | ||
*''' | *'''filePath:''' the path of the file to delete in the following format: '''":resourceName/path"'''. 'resourceName' is the name of the resource the file is in, and 'path' is the path from the root directory of the resource to the file. | ||
:For example, if you want to delete a file name "myFile.txt" in the resource 'fileres', it can be deleted from another resource this way: ''fileDelete(":fileres/myFile.txt")''. | |||
:If the file is in the current resource, only the file path is necessary, e.g. ''fileDelete("myFile.txt")''. | |||
===Returns=== | ===Returns=== |
Revision as of 03:39, 30 July 2009
Deletes the specified file.
Syntax
bool fileDelete ( string filePath )
Required Arguments
- filePath: the path of the file to delete in the following format: ":resourceName/path". 'resourceName' is the name of the resource the file is in, and 'path' is the path from the root directory of the resource to the file.
- For example, if you want to delete a file name "myFile.txt" in the resource 'fileres', it can be deleted from another resource this way: fileDelete(":fileres/myFile.txt").
- If the file is in the current resource, only the file path is necessary, e.g. fileDelete("myFile.txt").
Returns
Returns true if successful, false otherwise (for example if there exists no file with the given name, or it does exist but is in use).
Example
--TODO