General utilities.
General utilities.
(basename x)
Returns a file name without the last extension.
Returns a file name without the last extension.
(bytes->string b)
Converts bytes to a string.
Converts bytes to a string.
(compressor-input-stream f)
Returns a compressor input stream from f, autodetecting the compressor type from the first few bytes of f. Returns java.io.BufferedInputStream if the compressor type is not known. Should be used inside with-open to ensure the InputStream is properly closed.
Returns a compressor input stream from f, autodetecting the compressor type from the first few bytes of f. Returns java.io.BufferedInputStream if the compressor type is not known. Should be used inside with-open to ensure the InputStream is properly closed.
(compressor-output-stream f)
(compressor-output-stream f k)
Returns a compressor output stream from f
and a compressor type k
. k
must be selected from :bgzip
, :gzip
or :bzip2
. Autodetects the
compressor type from the extension of f
if k
is not passed. Returns
java.io.BufferedOutputStream
if the compressor type is not known. Should be
used inside with-open to ensure the OutputStream is properly closed.
Returns a compressor output stream from `f` and a compressor type `k`. `k` must be selected from `:bgzip`, `:gzip` or `:bzip2`. Autodetects the compressor type from the extension of `f` if `k` is not passed. Returns `java.io.BufferedOutputStream` if the compressor type is not known. Should be used inside with-open to ensure the OutputStream is properly closed.
(create-temp-dir prefix)
Returns a created temporary directory with the given prefix
.
Returns a created temporary directory with the given `prefix`.
(delete-temp-dir! dir)
Takes the temporary directory created by create-temp-dir
and deletes the
dir
and the files in dir
.
Takes the temporary directory created by `create-temp-dir` and deletes the `dir` and the files in `dir`.
(graph? c)
Returns true if c is a visible character, false if not.
Returns true if c is a visible character, false if not.
(space? c)
Returns true if c is a character that creates "white space" in displayed text.
Returns true if c is a character that creates "white space" in displayed text.
(string->bytes s)
Converts a string to bytes.
Converts a string to bytes.
(ubyte n)
Casts to byte avoiding an error about out of range for byte.
Casts to byte avoiding an error about out of range for byte.
(with-temp-dir bindings & body)
bindings => [dir prefix ...]
Creates a temporary directory with the given prefix
and binds the given
dir
to it. Finally, deletes dir
and the files in dir
.
bindings => [dir prefix ...] Creates a temporary directory with the given `prefix` and binds the given `dir` to it. Finally, deletes `dir` and the files in `dir`.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close