def is_dir

bolt@1.27.0.0 · src/walk/disk.bend:66

import bolt@1.27.0.0/src/walk/disk.bend as Disk
import Base

66# whether a path is a directory: it opens, and reading it fails as a
67# directory's read does. Base's File has no stat, and a directory opens for
68# reading on both lanes.
69def is_dir(path: String) -> IO(Bool):  # noqa: L001 disk effect
70  do IO<Bool>:
71    r : Result<&1, &1, U32 & String, File> <- File.open(path, "r")
72    is_dir.opened(r)

Uses (10)

Used by (1)