(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.
Deletes a file with any implementation.
Deletes a file with any implementation.
Returns true
if filename exists
Returns `true` if filename exists
(file-reader filename)
(file-reader filename options)
Return a file reader
Return a file reader
(file-writer filename)
(file-writer filename options)
Return a file writer
Return a file writer
(get-file-type filename)
(get-file-type filename _ & _)
Dispatch function for files IO multimethods.
Dispatch function for files IO multimethods.
(gzipped? filename)
Tests if a filename ends with .gz or .gzip
Tests if a filename ends with .gz or .gzip
(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.
Return a seq of directories with provided path as prefix
Return a seq of directories with provided path as prefix
Returns a seq of filenames with provided path as prefix.
Returns a seq of filenames with provided path as prefix.
Returns an input stream with any implementation.
Returns an input stream with any implementation.
Returns an output stream with any implementation.
Returns an output stream with any implementation.
(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.
(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.
Unzip the targeted file to the current
directory. If not a Zip file, yield nil
Unzip the targeted file to the current directory. If not a Zip file, yield `nil`
Create zip from target directory
Create zip from target directory
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close