From 63753c5e8405837931510b8da648dc75d4970fe1 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Fri, 22 Nov 2013 20:11:24 +0100 Subject: Added cFile:GetFolderContents(). Fix 162. --- MCServer/Plugins/APIDump/APIDesc.lua | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'MCServer/Plugins/APIDump') diff --git a/MCServer/Plugins/APIDump/APIDesc.lua b/MCServer/Plugins/APIDump/APIDesc.lua index 11b0aeff7..8591d9aa4 100644 --- a/MCServer/Plugins/APIDump/APIDesc.lua +++ b/MCServer/Plugins/APIDump/APIDesc.lua @@ -927,22 +927,23 @@ end cFile = { Desc = [[ - Provides helper functions for manipulating and querying the filesystem. Most functions are called - directly on the cFile class itself: + Provides helper functions for manipulating and querying the filesystem. Most functions are static, + so they should be called directly on the cFile class itself:
 cFile:Delete("/usr/bin/virus.exe");
 

]], Functions = { - Copy = { Params = "SrcFileName, DstFileName", Return = "bool", Notes = "Copies a single file to a new destination. Returns true if successful. Fails if the destination already exists." }, - CreateFolder = { Params = "FolderName", Return = "bool", Notes = "Creates a new folder. Returns true if successful." }, - Delete = { Params = "FileName", Return = "bool", Notes = "Deletes the specified file. Returns true if successful." }, - Exists = { Params = "FileName", Return = "bool", Notes = "Returns true if the specified file exists." }, - GetSize = { Params = "FileName", Return = "number", Notes = "Returns the size of the file, or -1 on failure." }, - IsFile = { Params = "Path", Return = "bool", Notes = "Returns true if the specified path points to an existing file." }, - IsFolder = { Params = "Path", Return = "bool", Notes = "Returns true if the specified path points to an existing folder." }, - Rename = { Params = "OrigPath, NewPath", Return = "bool", Notes = "Renames a file or a folder. Returns true if successful. Undefined result if NewPath already exists." }, + Copy = { Params = "SrcFileName, DstFileName", Return = "bool", Notes = "(STATIC) Copies a single file to a new destination. Returns true if successful. Fails if the destination already exists." }, + CreateFolder = { Params = "FolderName", Return = "bool", Notes = "(STATIC) Creates a new folder. Returns true if successful." }, + Delete = { Params = "FileName", Return = "bool", Notes = "(STATIC) Deletes the specified file. Returns true if successful." }, + Exists = { Params = "FileName", Return = "bool", Notes = "(STATIC) Returns true if the specified file exists." }, + GetFolderContents = { Params = "FolderName", Return = "array table of strings", Notes = "(STATIC) Returns the contents of the specified folder, as an array table of strings. Each filesystem object is listed. Use the IsFile() and IsFolder() functions to determine the object type." }, + GetSize = { Params = "FileName", Return = "number", Notes = "(STATIC) Returns the size of the file, or -1 on failure." }, + IsFile = { Params = "Path", Return = "bool", Notes = "(STATIC) Returns true if the specified path points to an existing file." }, + IsFolder = { Params = "Path", Return = "bool", Notes = "(STATIC) Returns true if the specified path points to an existing folder." }, + Rename = { Params = "OrigPath, NewPath", Return = "bool", Notes = "(STATIC) Renames a file or a folder. Returns true if successful. Undefined result if NewPath already exists." }, }, }, -- cFile -- cgit v1.2.3