Skip to main content
版本:v3

hmFS.rename(oldPath, newPath)

重命名文件

类型

(oldPath: string, newPath: string) => result

参数

参数说明必填类型默认值
oldPath旧文件路径string-
newPath新文件路径string-

result

说明类型
操作结果,0 表示成功number

代码示例

const result = hmFS.rename('path/to/old_file.txt', 'path/to/new_file.txt')
console.log(result)