rename
Module @netwiv/api/plugins/fs · Kind Function
import { rename } from '@netwiv/api/plugins/fs';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.
Signature
Section titled “Signature”function rename(oldPath: string | URL, newPath: string | URL, options?: RenameOptions | undefined): Promise<void>Example
Section titled “Example”import { rename, BaseDirectory } from '@netwiv/api/plugins/fs';await rename('avatar.png', 'deleted.png', { oldPathBaseDir: BaseDirectory.App, newPathBaseDir: BaseDirectory.AppLocalData });Upstream since 2.0.0
Descriptions come from the pinned @tauri-apps/plugin-fs@2.5.2 declarations (MIT OR Apache-2.0); imports are shown with @netwiv/api paths.