Liking cljdoc? Tell your friends :D

edd.io.core

Basic IO utilities for streams, files, GZIP encoding and decoding, MIME detection, and similar things. The goal is to not depend on the clojure.java.io namespace.

Basic IO utilities for streams, files, GZIP encoding
and decoding, MIME detection, and similar things.
The goal is to not depend on the clojure.java.io
namespace.
raw docstring

delete-fileclj

(delete-file file)

Physically delete a file.

Physically delete a file.
raw docstring

fileclj

(file arg)
(file parent child)
(file parent child & more)

A proxy to the standard io/file function.

A proxy to the standard io/file function.
raw docstring

file->extensionclj

(file->extension file)

Given a file instance, return if extension detected as everything after the last dot.

Given a file instance, return if extension detected
as everything after the last dot.
raw docstring

file->mime-typeclj

(file->mime-type file)

Given a file instance, guess its MIME type by an extension. Only basic types are supported. Default is application/octet-stream.

Given a file instance, guess its MIME type by an extension.
Only basic types are supported. Default is application/octet-stream.
raw docstring

file->nameclj

(file->name file)

Return the basic file name.

Return the basic file name.
raw docstring

file-exists?clj

(file-exists? file)

Whether the file exists or not.

Whether the file exists or not.
raw docstring

file-sizeclj

(file-size file)

Return the file size in bytes as Long.

Return the file size in bytes as Long.
raw docstring

file?clj

(file? src)

get-temp-fileclj

(get-temp-file)
(get-temp-file prefix suffix)

Return an temporal file, an instance of java.io.File class.

Return an temporal file, an instance of java.io.File class.
raw docstring

gzip-input-streamclj

(gzip-input-stream src)

Coerce the source into the GZIPInputStream instance.

Coerce the source into the GZIPInputStream instance.
raw docstring

gzip-output-streamclj

(gzip-output-stream src)

Coerce the source into the GZIPOutputStream instance.

Coerce the source into the GZIPOutputStream instance.
raw docstring

gzip-readerclj

(gzip-reader src)

input-streamclj

(input-stream src)
(input-stream src & opts)

A proxy to the standard io/input-stream function.

A proxy to the standard io/input-stream function.
raw docstring

input-stream?clj

(input-stream? src)

is-directory?clj

(is-directory? file)

Whether the file is a directory or not

Whether the file is a directory or not
raw docstring

output-streamclj

(output-stream src)
(output-stream src & opts)

A proxy to the standard io/output-stream function.

A proxy to the standard io/output-stream function.
raw docstring

output-stream?clj

(output-stream? src)

pushback-readerclj

(pushback-reader src)

read-bytesclj

(read-bytes src)

Read all bytes from a source into a byte array.

Read all bytes from a source into a byte array.
raw docstring

read-ednclj

(read-edn src)
(read-edn src opt)

Like clojure.edn/read but wraps the input into the pushback reader under the hood. The src is anything which can be converted into an input-stream.

Like `clojure.edn/read` but wraps the input into
the pushback reader under the hood. The `src` is
anything which can be converted into an input-stream.
raw docstring

readerclj

(reader src)
(reader src & opts)

A proxy to the standard io/reader function.

A proxy to the standard io/reader function.
raw docstring

reader?clj

(reader? src)

resource!clj

(resource! path)

Get a resource throwing an exception when it's missing.

Get a resource throwing an exception when it's missing.
raw docstring

with-pipecljmacro

(with-pipe [out in size] & body)

A macro to manage piped writing/reading across two threads. The idea is to write bytes into an output but not exhaust disk and memory, while another thread is consuming the connected input stream.

  • out is bound to a new instance of PipedOutputStream
  • in is bound to a new instance of PipedInputStream
  • size is an optional size for the in.

The in is connected to the out meaning everything written to the out is available from in again. The out gets closed when exiting the macro. The in does not because it is used in another thread. You spawn a future that reads from the in, write anything you want to the out, and return the future. Example:

(with-pipe [o i 0xFF] (let [fut (future (.readAllBytes i))] (doseq [x (range 0 3)] (.write o x)) fut))

Both out and in can be wrapped with Gzip in/output streams, writers/readers, etc.

A macro to manage piped writing/reading across two threads.
The idea is to write bytes into an output but not exhaust
disk and memory, while another thread is consuming the
connected input stream.

- `out` is bound to a new instance of PipedOutputStream
- `in` is bound to a new instance of PipedInputStream
- `size` is an optional size for the in.

The in is connected to the out meaning everything written
to the out is available from in again. The out gets closed
when exiting the macro. The in does not because it is used
in another thread. You spawn a future that reads from
the in, write anything you want to the out, and return
the future. Example:

(with-pipe [o i 0xFF]
  (let [fut (future
              (.readAllBytes i))]
    (doseq [x (range 0 3)]
      (.write o x))
    fut))

Both out and in can be wrapped with Gzip in/output streams,
writers/readers, etc.
raw docstring

with-tmp-filecljmacro

(with-tmp-file [bind prefix suffix] & body)

Execute the body while the bind symbol is bound to a temporal file. Afterwards, the file is deleted.

Execute the body while the `bind` symbol is bound
to a temporal file. Afterwards, the file is deleted.
raw docstring

write-fileclj

(write-file src file)

Write src into a given File instance.

Write src into a given File instance.
raw docstring

write-temp-fileclj

(write-temp-file src)
(write-temp-file src prefix suffix)

Write src into temp file and return it.

Write src into temp file and return it.
raw docstring

write-temp-file-gzipclj

(write-temp-file-gzip src)

Write src into a gzipped temp file and return it.

Write src into a gzipped temp file and return it.
raw docstring

writerclj

(writer src)
(writer src & opts)

A proxy to the standard io/writer function.

A proxy to the standard io/writer function.
raw docstring

writer?clj

(writer? src)

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