List Files On The Controller (LCC.web_file.list)
Signature
list, err = LCC.web_file.list(path, recursive?, timeout?)
Parameters
- path
String. Directory path on the controller to inspect. - recursive
Boolean, optional. Whentrue, lists subfolders recursively; defaultfalse. - timeout
Number, optional. Request timeout in seconds, default60.
Returns
- list
Table. Array of file/directory descriptors from the controller;nilon failure. - err
String ornil. Error description when the call fails.
Notes
Lists files and subdirectories under the given path.
Requires the controller address to be set or the script to be launched by the controller.
Each entry includesname,path,dir,symlink,size, andmodification.
symlinkindicates whether the entry itself is a symlink; when the target is reachable,dirandsizereflect the target state.
Example
local nodes, err = LCC.web_file.list("/scripts", true)
if not nodes then
error(err)
end