FileSystemManager.stat

Requires:
BaseKit≥2.4.3
Platforms:
iOSAndroid

Method signature
FileSystemManager.stat(params: )

Description

Get the file Stats object; requires file read/write permission

Parameters

PropertyTypeRequiredDefaultDescription
pathstringYes-File/directory path (local path)
recursivebooleanNofalseWhether to recursively get Stats info for each file under the directory. Default: false
complete() => voidNo-Completion callback (executed on both success and failure)
success(params: Object) => voidNo-Callback on successful API call
fail(params: Object) => voidNo-Failure callback
success callback parameters
PropertyTypeDescriptionSince
[]File listv3.2.6
fail callback parameters
PropertyTypeDescription
errorMsgstringError message
errorCodestring | numberError code
Error extension

Return Value

None

Examples

import { getFileSystemManager } from '@ray-js/ray'

// Get file/directory stats; here we read the UserData root directory.
const fm = await getFileSystemManager();

fm.stat({
  path: "thingfile://usr/",
  recursive: false,
  success: data => {
    console.log(data);
  },
  fail: error => {
    console.error(error);
  },
});