link
Creates a hard link.
Example
ts
import { SF } from "@duplojs/server-utils";
import { E } from "@duplojs/utils";
const result = await SF.link("/tmp/original", "/tmp/hardlink");
// result: E.Ok | SF.FileSystemLeft<"link">
if (E.isRight(result)) {
// link is create with success
}Syntax
typescript
function link(
existingPath: string,
newPath: string
): Promise<FileSystemLeft<"link"> | E.Ok>Parameters
existingPath: path of the source resource.newPath: path of the link to create.
Return value
E.Ok: if creation succeeds.FileSystemLeft<"link">: if creation fails.
See also
symlink- Creates a symbolic link.
