Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/adka/deno.d.ts>Deno.renameSync

SSG & SSR: Static site generator and server side rendering using JSX.
Latest
function Deno.renameSync
import { Deno } from "https://deno.land/x/adka@0.1.5/deno.d.ts";
const { renameSync } = Deno;

Synchronously renames (moves) oldpath to newpath. Paths may be files or directories. If newpath already exists and is not a directory, renameSync() replaces it. OS-specific restrictions may apply when oldpath and newpath are in different directories.

Deno.renameSync("old/path", "new/path");

On Unix, this operation does not follow symlinks at either path.

It varies between platforms when the operation throws errors, and if so what they are. It's always an error to rename anything to a non-empty directory.

Requires allow-read and allow-write permissions.

Parameters

oldpath: string
newpath: string