Vault.rename method
Vault › rename
Official
Rename or move a file. To ensure links are automatically renamed, use FileManager.renameFile instead.This method only moves the file: links pointing to it are left as they were, so they break. FileManager.renameFile moves it the same way and then updates the links, asking the user first when the "Automatically update internal links" setting is off.
Signature:
rename(file: TAbstractFile, newPath: string): Promise<void>Parameters:
| Parameter | Type | Description |
|---|---|---|
| file | TAbstractFile | The file or folder. |
| newPath | string | The new vault absolute path. |
Since: 0.9.11