FileSystemManager.writeFileSync

Requires:
BaseKit≥2.4.3
Platforms:
iOSAndroid

Method signature
FileSystemManager.writeFileSync(params?: )

Description

Write to a file; requires file read/write permission

Parameters

ParameterTypeRequiredDescription
NoParameter object

Return Value

None

Examples

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

// File operation methods are exposed on the getFileSystemManager handle (fileId is injected automatically by the handle).
const fm = await getFileSystemManager();

fm.writeFile({
  filePath: "thingfile://usr/ttt_demo.txt",
  data: "hello ttt",
  encoding: "utf8",
  success: data => {
    console.log(data);
  },
  fail: error => {
    console.error(error);
  },
});