Liking cljdoc? Tell your friends :D

tools.io.core


close!clj

(close! {:keys [stream close-fn] :as file})

Close a stream and optionally call its close-fn function if it's present.

Close a stream and optionally call its close-fn function if it's present.
sourceraw docstring

copyclj

(copy input output opts)
source

delete-filecljmultimethod

Deletes a file with any implementation.

Deletes a file with any implementation.
sourceraw docstring

exists?cljmultimethod

Returns true if filename exists

Returns `true` if filename exists
sourceraw docstring

file-predsclj

source

file-readerclj

(file-reader filename)
(file-reader filename options)

Return a file reader

Return a file reader
sourceraw docstring

file-writerclj

(file-writer filename)
(file-writer filename options)

Return a file writer

Return a file writer
sourceraw docstring

get-file-typeclj

(get-file-type filename)
(get-file-type filename _ & _)

Dispatch function for files IO multimethods.

Dispatch function for files IO multimethods.
sourceraw docstring

gzipped?clj

(gzipped? filename)

Tests if a filename ends with .gz or .gzip

Tests if a filename ends with .gz or .gzip
sourceraw docstring

input-streamclj

(input-stream filename)
(input-stream filename options)

Returns an input-stream, with support of gzip compression.

Returns an input-stream, with support of gzip compression.
sourceraw docstring

list-dirscljmultimethod

Return a seq of directories with provided path as prefix

Return a seq of directories with provided path as prefix
sourceraw docstring

list-filescljmultimethod

Returns a seq of filenames with provided path as prefix.

Returns a seq of filenames with provided path as prefix.
sourceraw docstring

mk-input-streamcljmultimethod

Returns an input stream with any implementation.

Returns an input stream with any implementation.
sourceraw docstring

mk-output-streamcljmultimethod

Returns an output stream with any implementation.

Returns an output stream with any implementation.
sourceraw docstring

output-streamclj

(output-stream filename)
(output-stream filename options)

Returns an output-stream, with support of gzip compression.

Returns an output-stream, with support of gzip compression.
sourceraw docstring

register-file-pred!clj

(register-file-pred! file-type file-pred)

Extend the dispatch function of the multimethods with your own implementation.

Example:

(register-file-pred! :my-filetype (fn [filename] (clojure.string/starts-with? (str filename) "myprotocol://")))

(defmethod mk-input-stream :my-filetype [filename & [options]] ;; ... {:stream ...} )

The code above is sufficient to get all reading function for free on your custom protocol, given that mk-input-stream works correctly.

Extend the dispatch function of the multimethods with your own
implementation.

Example:

  (register-file-pred!
    :my-filetype
    (fn [filename] (clojure.string/starts-with? (str filename) "myprotocol://")))

  (defmethod mk-input-stream :my-filetype
    [filename & [options]]
    ;; ...
    {:stream ...}
    )

The code above is sufficient to get all reading function for free on your
custom protocol, given that mk-input-stream works correctly.
sourceraw docstring

unregister-file-pred!clj

(unregister-file-pred! file-type)
source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close