ALPHA - Not yet released
Note: currently only supports .clj
files.
Note: no explicit windowa support.
makejack.api.filesystem
File system manipulation functions.
copy-file!
(copy-file! source-path target-path)
(copy-file! source-path target-path {:keys [copy-attributes replace-existing], :as options})
copy-files!
(copy-files! source-path target-path)
(copy-files! source-path target-path {:keys [copy-attributes replace-existing follow-links], :as options})
delete-file!
(delete-file! path-like)
Delete the file at the specified path-like. Semantics as for java.nio.file.Files/delete.
list-paths
(list-paths path-like)
(list-paths path-like {:keys [follow-links], :as options})
Return a lazy sequence of paths under path in depth first order.
make-temp-dir
(make-temp-dir prefix-or-options)
Return a newly created temporary directory. Prefix is an arbitary string that is used to name the directory. Options is a map with the keys: :delete-on-exit - delete the dir on JVM exit (default true). :dir - directory to create the dir in (default is the system temp dir). Must be of type that can be passed to clojure.java.io/dir. :prefix - a string that is used to name the directory.
make-temp-path
(make-temp-path options-or-prefix)
Return a temporary file path.
The options map can pass the keys:
:delete-on-exit - delete the file on JVM exit (default false) :dir - the directory in which to create the file (defaults to the system temp dir). Must be a path-like. :prefix - prefix for the file name (default “tmp”). Must be at elast three characters long. :suffix - suffix for the file name (default “.tmp”)
As a shortcut, a prefix string can be passed instead of the options mao.
with-temp-dir
macro
(with-temp-dir bindings & body)
bindings => [name prefix-or-options …]
Evaluate body with names bound to java.io.File objects of newly created temporary directories, and a finally clause that deletes them recursively in reverse order.
Prefix is a string that is used to name the directory. Options is a map with the keys: :delete-on-exit - delete the dir on JVM exit (default true) :dir - directory to create the dir in (default is the system temp dir). Must be of type that can be passed to clojure.java.io/dir. :prefix - a string that is used to name the directory.
with-temp-path
macro
(with-temp-path bindings & body)
A scope with sym bound to a java.io.File object for a temporary file in the system’s temporary directory.
Options is a map with the keys:
:delete - delete file when leaving scope (default true) :delete-on-exit - delete the file on JVM exit (default false) :dir - directory to create the file in (default is the system temp dir). Must be of type that can be passed to clojure.java.io/file. :prefix - prefix for the file name (default “tmp”) Must be at elast three characters long. :suffix - suffix for the file name (default “.tmp”)