Synchronous file system operations — a JVM mirror of bun.fs. Paths are
strings in, strings out (no java.nio.Path leakage); failures throw
Node-style ex-info (:type :fs-error, :code ENOENT/EACCES/…). See
docs/MIRROR.md for the parity contract.
Synchronous file system operations — a JVM mirror of `bun.fs`. Paths are strings in, strings out (no `java.nio.Path` leakage); failures throw Node-style `ex-info` (`:type :fs-error`, `:code` ENOENT/EACCES/…). See `docs/MIRROR.md` for the parity contract.
(cwd)Returns the current working directory.
Returns the current working directory.
(delete path)Deletes a file. Ignores missing files (rm -f). Returns nil.
Deletes a file. Ignores missing files (rm -f). Returns nil.
(directory? path)Returns true if path is a directory. Mirrors bun.fs/directory? Never throws — returns false on missing path.
Returns true if path is a directory. Mirrors bun.fs/directory? Never throws — returns false on missing path.
(dirname p)Returns the directory portion of a path. Does NOT resolve relative paths. Returns "." for empty string and bare filenames, "/" for the root, and "/" for a single-segment path under root (e.g. (dirname "/foo") => "/"). Strips all trailing slashes — (dirname "/a/b/c//") => "/a/b" — matching node:path.dirname.
Approximate parity: POSIX double-slash root (e.g. (dirname "//foo") returns "//" under Node) is NOT preserved; bushka collapses to "/". Kiln M1 never feeds such inputs. See MIRROR.md.
Returns the directory portion of a path. Does NOT resolve relative paths. Returns "." for empty string and bare filenames, "/" for the root, and "/" for a single-segment path under root (e.g. (dirname "/foo") => "/"). Strips all trailing slashes — (dirname "/a/b/c//") => "/a/b" — matching node:path.dirname. Approximate parity: POSIX double-slash root (e.g. (dirname "//foo") returns "//" under Node) is NOT preserved; bushka collapses to "/". Kiln M1 never feeds such inputs. See MIRROR.md.
(exists? path)Returns true if path exists. Mirrors bun.fs/exists? Never throws — returns false on any access error or missing path.
Returns true if path exists. Mirrors bun.fs/exists? Never throws — returns false on any access error or missing path.
(mkdir path)Creates directory and any missing parents. Mirrors bun.fs/mkdir (recursive: true). Idempotent — does not throw if the directory already exists. Returns nil.
Creates directory and any missing parents. Mirrors bun.fs/mkdir (recursive: true). Idempotent — does not throw if the directory already exists. Returns nil.
(path & segments)Joins and resolves path segments. Returns absolute path string. Mirrors node:path.resolve — walks segments left-to-right, restarting the accumulator from any absolute segment, then resolves the remainder against CWD if no absolute segment was seen. (path "/a" "/b") => "/b".
Joins and resolves path segments. Returns absolute path string. Mirrors node:path.resolve — walks segments left-to-right, restarting the accumulator from any absolute segment, then resolves the remainder against CWD if no absolute segment was seen. (path "/a" "/b") => "/b".
(read-edn path)Reads and parses EDN file. Mirrors bun.fs/read-edn.
Reads and parses EDN file. Mirrors bun.fs/read-edn.
(readdir path)Returns vec of filenames (not full paths) in directory. Mirrors bun.fs/readdir.
Returns vec of filenames (not full paths) in directory. Mirrors bun.fs/readdir.
(relative from to)Return the relative path from from to to. Mirrors node:path.relative:
both inputs are resolved to absolute paths against CWD before relativizing.
Required for Java parity — JVM's Path.relativize throws
IllegalArgumentException on mixed abs/rel inputs, whereas Node returns
a string.
Return the relative path from `from` to `to`. Mirrors node:path.relative: both inputs are resolved to absolute paths against CWD before relativizing. Required for Java parity — JVM's Path.relativize throws IllegalArgumentException on mixed abs/rel inputs, whereas Node returns a string.
(slurp path & {:keys [encoding] :or {encoding "utf-8"}})Reads file content as string. Options: :encoding (default "utf-8").
Reads file content as string. Options: :encoding (default "utf-8").
(spit path
content
&
{:keys [append encoding] :or {append false encoding "utf-8"}})Writes content to file. Returns nil. Options: :append (default false), :encoding (default "utf-8").
Writes content to file. Returns nil. Options: :append (default false), :encoding (default "utf-8").
(temp-dir prefix)Creates a temporary directory with the given prefix. Returns its path. Mirrors bun.fs/temp-dir.
Creates a temporary directory with the given prefix. Returns its path. Mirrors bun.fs/temp-dir.
(write-edn path data)Writes data as EDN to a file. Returns nil.
Writes data as EDN to a file. Returns nil.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |