/** * Create a directory chain under `parent`, one component at a time, **refusing to follow a * symlink**: an existing component that is a symlink (or a non-directory) is a hard error. A * pre-planted symlink parent would otherwise let an exclusive-create (`wx`) write land outside the * intended Cotal-owned tree — `wx` only guards the final path, not its parents, and a lexical * `dirname` check doesn't catch symlink traversal. Missing components are created `0700`. * * Narrow by design: it closes the pre-planted-symlink hole (the local single-user threat), not a * racing attacker (check→create isn't atomic). Returns the final directory path. */ export declare function ensureDirNoSymlink(parent: string, ...segments: string[]): string; /** * Walk a directory chain under `parent` one component at a time **without following symlinks**, for * a *destructive* caller (e.g. `cotal down -f` removing run artifacts). An existing component that is * a symlink or a non-directory is a hard error — so a recursive delete can't be redirected outside * the intended tree through a pre-planted symlinked parent. Returns the resolved final path if it * exists (a real directory), or `null` if any component is absent (nothing to delete — not an error). */ export declare function realDirNoSymlink(parent: string, ...segments: string[]): string | null; /** * Delete a single **regular file** at `path` without following a symlink: `lstat` it first and * refuse (throw) if it's a symlink or anything other than a regular file, so a destructive caller * (cred cleanup in `cotal down -f`) can't be tricked into unlinking a symlink target elsewhere. * Returns `true` if a file was removed, `false` if nothing was there (`ENOENT`). The caller is * responsible for proving `path`'s parent chain is symlink-free (e.g. derived under a known root). */ export declare function unlinkFileNoFollow(path: string): boolean; //# sourceMappingURL=fs-safe.d.ts.map