symlink
Crée un lien symbolique.
Exemple
ts
import { SF } from "@duplojs/server-utils";
const result = await SF.symlink("/tmp/target", "/tmp/link");
// result: E.Ok | SF.FileSystemLeft
await SF.symlink("/tmp/target", "/tmp/link-file", { type: "file" });Syntaxe
typescript
function symlink(
oldPath: string | URL,
newPath: string | URL,
params?: {
type: "file" | "dir" | "junction";
}
): Promise<FileSystemLeft | E.Ok>Paramètres
oldPath: chemin cible du lien.newPath: chemin du lien a créer.params.type: type du lien (Windows uniquement).
Valeur de retour
E.Ok: si la création réussit.FileSystemLeft: si la création échoue.
Notes
- Sur Windows,
typepeut etre"file","dir"ou"junction".
