Liking cljdoc? Tell your friends :D

sturdy.fs


chmod-400!clj

(chmod-400! path)

On POSIX file systems set r--------.

On POSIX file systems set r--------.
sourceraw docstring

chmod-600!clj

(chmod-600! path)

On POSIX file systems set rw-------.

On POSIX file systems set rw-------.
sourceraw docstring

ensure-400clj

(ensure-400 path)

Asserts file has r-------- permissions. Throws on mismatch. Returns path.

Asserts file has r-------- permissions. Throws on mismatch. Returns path.
sourceraw docstring

ensure-600clj

(ensure-600 path)

Asserts file has rw------- permissions. Throws on mismatch. Returns path.

Asserts file has rw------- permissions. Throws on mismatch. Returns path.
sourceraw docstring

ensure-parent!clj

(ensure-parent! path)

Create parent directories for path if needed.

Create parent directories for `path` if needed.
sourceraw docstring

read-linesclj

(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.
sourceraw docstring

slurp-bytesclj

(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.
sourceraw docstring

slurp-ednclj

(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.
sourceraw docstring

slurp-stringclj

(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.
sourceraw docstring

spit-bytes!clj

(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.
sourceraw docstring

spit-edn!clj

(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.
sourceraw docstring

spit-string!clj

(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)
sourceraw docstring

utf8clj

source

with-extensionclj

(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`.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close