Skip to main content
Module

x/denops_std/function/mod.ts>rename

📚 Standard module for denops.vim
Go to Latest
function rename
import { rename } from "https://deno.land/x/denops_std@v6.4.0/function/mod.ts";

Rename the file by the name {from} to the name {to}. This should also work to move files across file systems. The result is a Number, which is 0 if the file was renamed successfully, and non-zero when the renaming failed. NOTE: If {to} exists it is overwritten without warning. This function is not available in the sandbox.

Can also be used as a method:

GetOldName()->rename(newname)

Parameters

denops: Denops
from: unknown
to: unknown

Returns

Promise<number>