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
if (E.isRight(result)) {
// link is create with success
}Syntax
typescript
function link(
existingPath: string | URL,
newPath: string | URL
): Promise<FileSystemLeft | E.Ok>Parameters
existingPath: path of the source resource.newPath: path of the link to create.
Return value
E.Ok: if creation succeeds.FileSystemLeft: if creation fails.
See also
symlink- Creates a symbolic link.
