(as-file! f)
Coerce argument to an io/file. Argument could be a string, an io/file or an io/resource
Coerce argument to an io/file. Argument could be a string, an io/file or an io/resource
(basename path)
Return the basename of a file path.
(basename "/foo/bar.gz") ; => "bar.gz" (basename "http://www.foo.com/qux/") ; => "qux"
Return the basename of a file path. (basename "/foo/bar.gz") ; => "bar.gz" (basename "http://www.foo.com/qux/") ; => "qux"
(copy from from-opts to to-opts)
(copy from from-opts to to-opts copy-opts)
Copy content of file to another file. The only key for copy-opts is :buffer-size that precises the buffer size used between reader and writer. This function may not be the optimal way to copy a file.
Copy content of file to another file. The only key for copy-opts is :buffer-size that precises the buffer size used between reader and writer. This function may not be the optimal way to copy a file.
(exists? filename & [options])
Returns true if a file exists.
(exists? "--i-dont-exists--") ; => false (exists? "https://www.oscaro.com/") ; => true
Returns true if a file exists. (exists? "--i-dont-exists--") ; => false (exists? "https://www.oscaro.com/") ; => true
(join-path x)
(join-path x & xs)
Join multiple parts of a path into one.
(join-path "gs://foo" "bar") ; => "gs://foo/bar" (join-path "gs://foo/" "bar") ; => "gs://foo/bar"
Join multiple parts of a path into one. (join-path "gs://foo" "bar") ; => "gs://foo/bar" (join-path "gs://foo/" "bar") ; => "gs://foo/bar"
(line-write {:keys [stream] :as _file} line)
Write one line in a file created with tools.io.core/file-writer. It is the caller's responsibility to close the file using tools.io.core/close! when it’s done.
Write one line in a file created with tools.io.core/file-writer. It is the caller's responsibility to close the file using tools.io.core/close! when it’s done.
(lines-write file lines)
Write lines in a file created with tools.io.core/file-writer and close it.
Write lines in a file created with tools.io.core/file-writer and close it.
(list-dirs path & [options])
Alias of tools.io.core/list-dirs.
Alias of tools.io.core/list-dirs.
(list-files path & [options])
Alias of tools.io.core/list-files for backward compatibility.
Alias of tools.io.core/list-files for backward compatibility.
(load-config-file filename)
(load-config-file filename parser)
Read and parse a configuration file.
edn, clj, json, js, yaml, yml supported
Protocols supported are those of tools.io.core/file-reader
Read and parse a configuration file. edn, clj, json, js, yaml, yml supported Protocols supported are those of `tools.io.core/file-reader`
(parent path)
Return the parent of a path.
Note it doesn't resolve symbolink links nor .
nor ..
.
Return the parent of a path. Note it doesn't resolve symbolink links nor `.` nor `..`.
(read-csv-file in)
(read-csv-file in stream-args & csv-args)
Returns a lazy seq of parsed csv row as vector from a [protocol://]csv[.zext] file. See http://clojure.github.io/data.csv/ for options Warning: The seq must be entirely consumed before the file is closed.
sample usage: (read-csv-file "infos_tarifs.csv" {:encoding "ISO-8859-1"} :separator ;)
Returns a lazy seq of parsed csv row as vector from a [protocol://]csv[.zext] file. See http://clojure.github.io/data.csv/ for options Warning: The seq must be entirely consumed before the file is closed. sample usage: (read-csv-file "infos_tarifs.csv" {:encoding "ISO-8859-1"} :separator \;)
Returns a lazy seq of parsed edn objects from a [protocol://]edn[.zext] file. Warning: The seq must be entirely consumed before the file is closed.
Returns a lazy seq of parsed edn objects from a [protocol://]edn[.zext] file. Warning: The seq must be entirely consumed before the file is closed.
Returns a lazy seq of parsed edn objects from [protocol://]edns[.zext] files. Warning: The seq must be entirely consumed before every files are closed.
Returns a lazy seq of parsed edn objects from [protocol://]edns[.zext] files. Warning: The seq must be entirely consumed before every files are closed.
Returns a lazy seq of parsed json objects from a [protocol://]jsons[.zext] file. Warning: The seq must be entirely consumed before the file is closed.
Returns a lazy seq of parsed json objects from a [protocol://]jsons[.zext] file. Warning: The seq must be entirely consumed before the file is closed.
Returns a lazy seq of parsed json objects from [protocol://]jsons[.zext] files. Warning: The seq must be entirely consumed before every files are closed.
Returns a lazy seq of parsed json objects from [protocol://]jsons[.zext] files. Warning: The seq must be entirely consumed before every files are closed.
(read-string-files-fn read-file-fn)
Builder for a files-reader function. This is equivalent to read-string-format-file-fn but the returned function expects a sequence of filenames instead of just one.
Builder for a files-reader function. This is equivalent to read-string-format-file-fn but the returned function expects a sequence of filenames instead of just one.
(read-string-format-file-fn read-fn)
Builder for a file-reader function.
Builder for a file-reader function.
Returns a lazy seq of string from a [protocol://]text[.zext] file. Warning: The seq must be entirely consumed before the file is closed.
Returns a lazy seq of string from a [protocol://]text[.zext] file. Warning: The seq must be entirely consumed before the file is closed.
(rm-rf path)
Recursively remove a directory.
Recursively remove a directory.
(sizeof target & [opts])
Returns the size of file or folder.
Returns the size of file or folder.
(slurp filename & opts)
Equivalent of clojure.core/slurp.
Equivalent of clojure.core/slurp.
(spit filename content & opts)
Equivalent of clojure.core/spit.
Equivalent of clojure.core/spit.
(splitext path)
Split a file path in a pair of (file-path-without-extension, extension).
Split a file path in a pair of (file-path-without-extension, extension).
(strip-bom s)
Remove the BOM on a string if necessary. See https://en.wikipedia.org/wiki/Byte_order_mark
Remove the BOM on a string if necessary. See https://en.wikipedia.org/wiki/Byte_order_mark
(unzip-file zip-file & [options])
Alias of tools.io.core/unzip-file.
Alias of tools.io.core/unzip-file.
(with-tempdir [x] & body)
Executes the body with a temporary directory whose name is bind to [x].
(with-tempdir [dirname] (println "There's a directory called" dirname ".")) (println "The directory is now gone.")
Executes the body with a temporary directory whose name is bind to [x]. (with-tempdir [dirname] (println "There's a directory called" dirname ".")) (println "The directory is now gone.")
(with-tempfile [x] & body)
Executes the body with a temporary file whose name is bind to [x].
(with-tempfile [filename] (println "There's a file called" filename ".")) (println "The file is now gone.")
Executes the body with a temporary file whose name is bind to [x]. (with-tempfile [filename] (println "There's a file called" filename ".")) (println "The file is now gone.")
(write-csv-file out stream-args & csv-args)
Writes a seq of vectors serialized as CSV in a [protocol://]csv[.zext] file. See http://clojure.github.io/data.csv/ for options.
(write-csv-file out my-lines) (write-csv-file out [stream-options-map] my-lines [csv options...])
Examples: (write-csv-file "animals.csv" [["name" "color"] ["cat" "black"] ["dog" "brown"]]) (write-csv-file "animals.csv" [["name" "color"] ["cat" "black"] ["dog" "brown"]] :separator ;)
(write-csv-file "people.csv" {:encoding "ISO-88591"} my-people) (write-csv-file "people.csv" {:encoding "ISO-88591"} my-people :separator ;)
Writes a seq of vectors serialized as CSV in a [protocol://]csv[.zext] file. See http://clojure.github.io/data.csv/ for options. (write-csv-file out my-lines) (write-csv-file out [stream-options-map] my-lines [csv options...]) Examples: (write-csv-file "animals.csv" [["name" "color"] ["cat" "black"] ["dog" "brown"]]) (write-csv-file "animals.csv" [["name" "color"] ["cat" "black"] ["dog" "brown"]] :separator \;) (write-csv-file "people.csv" {:encoding "ISO-88591"} my-people) (write-csv-file "people.csv" {:encoding "ISO-88591"} my-people :separator \;)
(write-edn-file filename x)
(write-edn-file filename options x)
Writes an element serialized as EDN in a [protocol://]edn[.zext] file. This is equivalent to call write-edns-file on a one-element sequence.
Writes an element serialized as EDN in a [protocol://]edn[.zext] file. This is equivalent to call write-edns-file on a one-element sequence.
Writes a seq of elements serialized as EDN in a [protocol://]edn[.zext] file.
Writes a seq of elements serialized as EDN in a [protocol://]edn[.zext] file.
Writes a seq of elements serialized as JSON in a [protocol://]jsons[.zext] file.
Writes a seq of elements serialized as JSON in a [protocol://]jsons[.zext] file.
(write-string-file-fn serialize-fn)
Builder for a file-writer function. This is the opposite of read-string-format-file-fn.
Builder for a file-writer function. This is the opposite of read-string-format-file-fn.
Writes a seq of strings in a [protocol://]text[.zext] file.
Writes a seq of strings in a [protocol://]text[.zext] file.
(zip-directory folder & [options])
Alias of tools.io.core/zip-directory.
Alias of tools.io.core/zip-directory.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close