FileSystemManager.access

Requires:
BaseKit≥2.4.3
Platforms:
iOSAndroid

Method signature
FileSystemManager.access(params: )

Description

Check whether a file/directory exists

Parameters

PropertyTypeRequiredDescription
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);
  },
});