FileSystemManager.access

Requires:
BaseKit≥2.4.3
Platforms:
iOSAndroid

Method signature
FileSystemManager.access(params: )
Minimum SDK versions
iOSThingSmartBaseKitBizBundle
≥ 5.2.1
Androidcom.thingclips.smart:thingsmart-bizbundle-basekit
≥ 5.2.0

Description

Check whether a file/directory exists

Parameters

PropertyTypeRequiredDescriptionMinimum SDK versions
pathstringYesThe file/directory path to check (local path)—
complete() => voidNoCompletion callback (executed on both success and failure)—
success() => voidNoCallback on successful API call—
fail(params: Object) => voidNoFailure callback—
fail callback parameters
PropertyTypeDescription
errorMsgstringError message
errorCodestring | numberError code
Error extension

Return Value

None

Examples

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

// Check whether a file/directory exists; here we check the UserData root directory (always exists).
const fm = await getFileSystemManager();

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