Skip to main content
Version: v3

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

PropertyTypeRequiredDefaultValueDescriptionAPI_LEVEL
pathstringY-path2.0

Result

TypeDescription
numberIf 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')
}