rename
rename(
oldPath
,newPath
,options?
):Promise
<void
>
Defined in: plugins/fs/guest-js/index.ts:916
Renames (moves) oldpath to newpath. Paths may be files or directories. If newpath already exists and is not a directory, rename() replaces it. OS-specific restrictions may apply when oldpath and newpath are in different directories.
On Unix, this operation does not follow symlinks at either path.
string
| URL
string
| URL
Promise
<void
>
import { rename, BaseDirectory } from '@tauri-apps/plugin-fs';await rename('avatar.png', 'deleted.png', { oldPathBaseDir: BaseDirectory.App, newPathBaseDir: BaseDirectory.AppLocalData });
2.0.0
© 2025 Tauri Contributors. CC-BY / MIT