(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)
Returns a file reader.
Returns a file reader.
(file-writer filename)
(file-writer filename options)
Returns a file writer.
Returns a file writer.
(get-file-type filename)
(get-file-type filename _ & _)
Dispatch function for files IO multimethods.
Dispatch function for files IO multimethods.
(input-stream filename)
(input-stream filename options)
Returns an input-stream for plain or compressed file.
Returns an input-stream for plain or compressed file.
Returns a seq of directories with provided path as prefix.
Returns 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 for plain or compressed file.
Returns an output-stream for plain or compressed file.
(register-file-pred! file-type file-pred)
Registers a new file type with a file predicate.
Extends 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.
Registers a new file type with a file predicate. Extends 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.
Probe the size of the target files/folder. Should not load dataset in memory.
Probe the size of the target files/folder. Should not load dataset in memory.
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`.
Creates zip from target directory.
Creates zip from target directory.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close