(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-400 path)Asserts file has r-------- permissions. Throws on mismatch. Returns path.
Asserts file has r-------- permissions. Throws on mismatch. Returns path.
(ensure-600 path)Asserts file has rw------- permissions. Throws on mismatch. Returns path.
Asserts file has rw------- permissions. Throws on mismatch. Returns path.
(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 {:keys [atomic? append]})Write byte[] to file. Creates parent dirs. Options: :append - true to append (mutually exclusive with :atomic?) :atomic? - true to write to temp file and move (mutually exclusive with :append) Other opts passed to fs/write-bytes.
Write byte[] to file. Creates parent dirs. Options: :append - true to append (mutually exclusive with :atomic?) :atomic? - true to write to temp file and move (mutually exclusive with :append) Other opts passed to 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] :as opts :or {charset utf8}})Write String. Creates parent dirs. Options: :charset - default UTF-8 :append - true to append (mutually exclusive with :atomic?) :atomic? - true to write to temp file and move (mutually exclusive with :append)
Write String. Creates parent dirs. Options: :charset - default UTF-8 :append - true to append (mutually exclusive with :atomic?) :atomic? - true to write to temp file and move (mutually exclusive with :append)
(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 |