Skip to main content
Version: Next

symlinkSync

function symlinkSync(
oldpath,
newpath,
options?
): void;

Sync version of symlink.

Parameters​

ParameterType

oldpath

string

newpath

string

options?

"dir" | "junction" | "file"

Returns​

void

Example​

try {
// Linux
Rsvim.fs.symlinkSync("README.md", "linked-README.md");
// Windows
Rsvim.fs.symlinkSync("README.md", "linked-README.md", "junction");
Rsvim.cmd.echo(`Created symbolic link "linked-README.md" pointing to "README.md"`);
} catch (e) {
Rsvim.cmd.echo(`Failed to create symbolic link pointing to "README.md": ${e}`);
}