FileSystemManager.readdir(Object object)
Reads the list of files in the directory.
Parameters
Object object
Attribute | Type | Default | Required | Description |
dirPath | string | | Yes | Path to the directory to be read |
success | function | | No | The callback function for a successful API call |
fail | function | | No | Callback function for failed API call |
complete | function | | No | Callback function used when API call completed (always executed whether call succeeds or fails) |
object.success callback function
Parameters
Object res
Property | Type | Description |
files | Array.<string> | The array of file names in the specified directory. |
object.fail callback function
Parameters
Object res
Property | Type | Description |
errMsg | string | Error message |
Valid values of res.errMsg
Value | Description | Minimum Version |
fail no such file or directory ${dirPath} | Directory does not exist | |
fail not a directory ${dirPath} | dirPath is not a directory | |
fail permission denied, open ${dirPath} | No read permission on the specified filePath | |