FileSystemManager.rmdir

Requires:
BaseKit≥2.4.3
Platforms:
iOSAndroid

Method signature
FileSystemManager.rmdir(params: )

Description

Delete a directory; requires file read/write permissions

Parameters

PropertyTypeRequiredDescription
dirPathstringYesPath of the directory to delete (local path)
recursivebooleanNoWhether to delete the directory recursively. If true, deletes the directory and all its subdirectories and files. Default: false
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'

// Create a directory first to ensure there's one to remove.
const fm = await getFileSystemManager();

fm.mkdir({
  dirPath: "thingfile://usr/ttt_demo_dir",
  recursive: true,
  success: () => {
    fm.rmdir({
      dirPath: "thingfile://usr/ttt_demo_dir",
      recursive: true,
      success: data => {
        console.log(data);
      },
      fail: error => {
        console.error(error);
      },
    });
  },
  fail: error => {
    console.error(error);
  },
});