import type { CallbackWithError } from "./_fs_common.ts";import { fromFileUrl } from "../path.ts";
export function link( existingPath: string | URL, newPath: string | URL, callback: CallbackWithError,): void { existingPath = existingPath instanceof URL ? fromFileUrl(existingPath) : existingPath; newPath = newPath instanceof URL ? fromFileUrl(newPath) : newPath;
Deno.link(existingPath, newPath) .then(() => callback()) .catch(callback);}
export function linkSync( existingPath: string | URL, newPath: string | URL,): void { existingPath = existingPath instanceof URL ? fromFileUrl(existingPath) : existingPath; newPath = newPath instanceof URL ? fromFileUrl(newPath) : newPath;
Deno.linkSync(existingPath, newPath);}