Skip to main content
Version: v3+

hmFS.rename(oldPath, newPath)

Rename file

Type​

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

Parameters​

ParametersDescriptionRequiredTypeDefault
oldPathold file pathyesstring-
newPathnew file pathyesstring-

result​

DescriptionType
The result of the operation, 0 means successnumber

Code example​

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