콘텐츠로 이동

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.

function rename(oldPath: string | URL, newPath: string | URL, options?: RenameOptions | undefined): Promise<void>
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.