ensureLinkSync
import { ensureLinkSync } from "jsr:@ende/fs";function
function ensureLinkSync(src: string | URL, dest: string | URL): voidSynchronously ensures that the hard link exists.
If the parent directories for the hard link do not exist, they are created.
Requires --allow-read and --allow-write permissions.
src: string | URLThe source file path as a string or URL. Directory hard links are not allowed.
dest: string | URLThe destination link path as a string or URL.
Returns
A void value that returns once the hard link exists.
Example: Usage
import { ensureLinkSync } from "@ende/fs/ensure-link";
ensureLinkSync("./folder/targetFile.dat", "./folder/targetFile.link.dat");
See also
https://docs.ende.sh/runtime/manual/basics/permissions#file-system-access for more information on Ende's permissions system.