Skip to content

canonicalize ​

Resolve um caminho para um caminho absoluto e normalizado, resolvendo todos os links simbólicos. Retorna FsError se o caminho não existir.

Assinaturacanonicalize(path: string): Result<string, FsError>

Exemplo ​

tyrus
import { canonicalize, FsError } from "tyrus:fs";

match (canonicalize("./file.txt")) {
    Ok(path) => { print(path); } // /home/user/project/file.txt
    Err(error) => { printError(error.code); } // ERR_FS_CANONICALIZE_FAILED
}