Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tidy references to :posix-file-permissions in docstrings #128

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Babashka [fs](https://github.com/babashka/fs): file system utility library for C
## Unreleased

- [#122](https://github.com/babashka/fs/issues/122): `fs/copy-tree`: fix copying read-only directories with children ([@sohalt](https://github.com/sohalt))
- [#127](https://github.com/babashka/fs/issues/127): Inconsistent documentation for the `:posix-file-permissions` options ([@teodorlu](https://github.com/teodorlu))

## v0.5.20 (2023-12-21)

Expand Down
23 changes: 16 additions & 7 deletions src/babashka/fs.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,9 @@
(PosixFilePermissions/toString p))

(defn str->posix
"Converts a string to a set of PosixFilePermission."
"Converts a string to a set of PosixFilePermission.

`s` is a string like `\"rwx------\"`."
[s]
(PosixFilePermissions/fromString s))

Expand Down Expand Up @@ -508,7 +510,9 @@
`(create-temp-dir {:keys [:prefix :dir :posix-file-permissions]})`:

create temp dir in dir path 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)`. The `:posix-file-permissions` option is a string like `\"rwx------\"`."
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."
([]
(Files/createTempDirectory
(str (java.util.UUID/randomUUID))
Expand All @@ -530,10 +534,12 @@
"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, random ones are generated. The `:posix-file-permissions`
option is a string like `\"rwx------\"`."

- `(create-temp-dir {:keys [:prefix :suffix :path :posix-file-permissions]})`:
create temp file in path 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."
([]
(Files/createTempFile
(str (java.util.UUID/randomUUID))
Expand Down Expand Up @@ -614,7 +620,10 @@
:continue)}))))

(defn create-file
"Creates empty file using `Files#createFile`."
"Creates empty file using `Files#createFile`.

File permissions can be specified with an `:posix-file-permissions` option.
String format for posix file permissions is described in the `str->posix` docstring."
([path]
(create-file path nil))
([path {:keys [:posix-file-permissions]}]
Expand Down
Loading