rmSync
Start from API_LEVEL
2.0
. Please refer to API_LEVEL.
Synchronously delete files in the /data
directory of the Mini Program.
Type
function rmSync(option: Option): Result
Simplified calling method
function rmSync(path: string): Result
Parameters
Option
Property | Type | Required | DefaultValue | Description | API_LEVEL |
---|---|---|---|---|---|
path | string | Y | - | path | 2.0 |
Result
Type | Description |
---|---|
number | If 0 is returned, success is indicated |
Example
import { rmSync } from '@zos/fs'
const result = rmSync({
path: 'test.txt',
})
if (result === 0) {
console.log('rmSync success')
}