(chmod-400! path)On POSIX file systems set r--------.
On POSIX file systems set r--------.
(chmod-600! path)On POSIX file systems set rw-------.
On POSIX file systems set rw-------.
(ensure-parent! path)Create parent directories for path if needed.
Create parent directories for `path` if needed.
(read-lines p)(read-lines p charset)Read file as a vector of lines. Charset defaults to UTF-8.
Read file as a vector of lines. Charset defaults to UTF-8.
(slurp-bytes p)Read entire file as byte[]. Throws if the file does not exist.
Read entire file as byte[]. Throws if the file does not exist.
(slurp-edn p)(slurp-edn p cs)Read entire file as EDN. Charset defaults to UTF-8.
Read entire file as EDN. Charset defaults to UTF-8.
(slurp-string p)(slurp-string p cs)Read entire file as String. Charset defaults to UTF-8.
Read entire file as String. Charset defaults to UTF-8.
(spit-bytes! p bytes)(spit-bytes! p bytes opts)Write byte[] to file. Creates parent dirs. Options: {:append true | :create true | :truncate-existing true} (defaults match fs/write-bytes).
Write byte[] to file. Creates parent dirs.
Options: {:append true | :create true | :truncate-existing true} (defaults match fs/write-bytes).(spit-edn! p map_)(spit-edn! p map_ {:keys [charset atomic?] :or {charset utf8}})Write EDN to file (prn-str). Creates parent dirs.
Write EDN to file (prn-str). Creates parent dirs.
(spit-string! p s)(spit-string! p s {:keys [charset atomic? append] :or {charset utf8}})Write String with charset (default UTF-8). Creates parent dirs. {:atomic? true} will write to a temp file and atomically move into place. Note: :append and :atomic? are mutually exclusive; use one or the other.
Write String with charset (default UTF-8). Creates parent dirs.
{:atomic? true} will write to a temp file and atomically move into place.
Note: :append and :atomic? are mutually exclusive; use one or the other.(with-extension path ext)Return a path equivalent to path but with its filename extension replaced by ext.
Return a path equivalent to `path` but with its filename extension replaced by `ext`.
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 |