FileSystemManager.mkdir

Requires:
BaseKit≥2.4.3
Platforms:
iOSAndroid

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

Description

Create a directory; requires file read/write permissions

Parameters

PropertyTypeRequiredDefaultDescriptionMinimum SDK versions
dirPathstringYes-Path of the directory to create (local path)—
recursivebooleanNofalseWhether to create parent directories recursively before creating this directory. If a parent directory already exists, it will not be created. For example, if dirPath is a/b/c/d and recursive is true, it creates directory a, then b under a, and so on until d under a/b/c. Default: false—
complete() => voidNo-Completion callback (executed on both success and failure)—
success() => voidNo-Callback on successful API call—
fail(params: Object) => voidNo-Failure callback—
fail callback parameters
PropertyTypeDescription
errorMsgstringError message
errorCodestring | numberError code
Error extension

Return Value

None

Examples

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

const fm = await getFileSystemManager();

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