Module ctr.fs
The fs module.
Usage:
local fs = require("ctr.fs")
-
list (path)
-
Lists a directory contents (unsorted).
Parameters:
- path
string
the directory we wants to list the content
Returns:
table
the item list. Each item is a table like:
{
name = "Item name.txt",
isDirectory = false,
size = 321 -- (integer) item size, in bytes
}
Or
-
nil
if an error occurred
-
string
error message
-
exists (path)
-
Check if a item (file or directory) exists.
Parameters:
Returns:
boolean
true if it exists, false otherwise
-
getDirectory ()
-
Get the current working directory.
Returns:
string
the current working directory
-
setDirectory (path)
-
Set the current working directory.
Parameters:
- path
path
of the new working directory
Returns:
boolean
true if success
Or
-
boolean
false if failed
-
string
error message
-
lzlib
-
The ctr.fs.lzlib module.
See also: