From 5da99ed3f32fbb4a49aa4119653b5a065aa8d345 Mon Sep 17 00:00:00 2001 From: Gert Goet Date: Thu, 2 May 2024 11:01:40 +0200 Subject: [PATCH] Update create-temp* docs (#129) --- API.md | 12 ++++++------ src/babashka/fs.cljc | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/API.md b/API.md index cae4764..b33c663 100644 --- a/API.md +++ b/API.md @@ -222,15 +222,15 @@ Create a soft link from path to target. ``` clojure (create-temp-dir) -(create-temp-dir {:keys [:prefix :dir :posix-file-permissions], :as opts}) +(create-temp-dir {:keys [:dir :prefix :posix-file-permissions], :as opts}) ``` Creates a temporary directory using Files#createDirectories. - `(create-temp-dir)`: creates temp dir with random prefix. - `(create-temp-dir {:keys [:prefix :dir :posix-file-permissions]})`: + - `(create-temp-dir)`: creates temp dir with random prefix. - create temp dir in dir path with prefix. If prefix is not provided, a random one + - `(create-temp-dir {:keys [:dir :prefix :posix-file-permissions]})`: + create temp dir in dir with prefix. If prefix is not provided, a random one is generated. If path is not provided, the directory is created as if called with `(create-temp-dir)`. File permissions can be specified with an `:posix-file-permissions` option. String format for posix file permissions is described in the [`str->posix`](#babashka.fs/str->posix) docstring. @@ -247,8 +247,8 @@ Creates an empty temporary file using Files#createTempFile. - `(create-temp-file)`: creates temp file with random prefix and suffix. - - `(create-temp-dir {:keys [:prefix :suffix :path :posix-file-permissions]})`: - create temp file in path with prefix. If prefix and suffix are not provided, + - `(create-temp-dir {:keys [:dir :prefix :suffix :posix-file-permissions]})`: + create temp file in dir with prefix. If prefix and suffix are not provided, random ones are generated. File permissions can be specified with an `:posix-file-permissions` option. String format for posix file permissions is described in the [`str->posix`](#babashka.fs/str->posix) docstring. diff --git a/src/babashka/fs.cljc b/src/babashka/fs.cljc index 2a21b53..eedd241 100644 --- a/src/babashka/fs.cljc +++ b/src/babashka/fs.cljc @@ -506,10 +506,10 @@ (defn create-temp-dir "Creates a temporary directory using Files#createDirectories. - `(create-temp-dir)`: creates temp dir with random prefix. - `(create-temp-dir {:keys [:prefix :dir :posix-file-permissions]})`: + - `(create-temp-dir)`: creates temp dir with random prefix. - create temp dir in dir path with prefix. If prefix is not provided, a random one + - `(create-temp-dir {:keys [:dir :prefix :posix-file-permissions]})`: + create temp dir in dir with prefix. If prefix is not provided, a random one is generated. If path is not provided, the directory is created as if called with `(create-temp-dir)`. File permissions can be specified with an `:posix-file-permissions` option. String format for posix file permissions is described in the `str->posix` docstring." @@ -517,7 +517,7 @@ (Files/createTempDirectory (str (java.util.UUID/randomUUID)) (make-array FileAttribute 0))) - ([{:keys [:prefix :dir :posix-file-permissions] :as opts}] + ([{:keys [:dir :prefix :posix-file-permissions] :as opts}] (let [attrs (posix->attrs posix-file-permissions) prefix (or prefix (str (java.util.UUID/randomUUID))) dir (or dir (:path opts))] @@ -535,8 +535,8 @@ - `(create-temp-file)`: creates temp file with random prefix and suffix. - - `(create-temp-dir {:keys [:prefix :suffix :path :posix-file-permissions]})`: - create temp file in path with prefix. If prefix and suffix are not provided, + - `(create-temp-dir {:keys [:dir :prefix :suffix :posix-file-permissions]})`: + create temp file in dir with prefix. If prefix and suffix are not provided, random ones are generated. File permissions can be specified with an `:posix-file-permissions` option. String format for posix file permissions is described in the `str->posix` docstring."