@neo2551 cider-pprint now works in the babashka nrepl server from master (also see #babashka_circleci_builds). Thanks @grazfather
Great! Thanks!
Works great, thanks @grazfather
Worked a bit on babashka.fs:
user=> (pprint (fs/read-attributes "." "*"))
{:creationTime
#object[java.nio.file.attribute.FileTime 0x62f9c790 "1970-01-01T00:00:00Z"],
:isSymbolicLink false,
:isOther false,
:lastAccessTime
#object[java.nio.file.attribute.FileTime 0x310d57b1 "2021-02-05T09:48:12.076597Z"],
:isRegularFile false,
:size 608,
:lastModifiedTime
#object[java.nio.file.attribute.FileTime 0x52f8a6f4 "2021-02-04T10:06:30.52264Z"],
:fileKey
#object[sun.nio.fs.UnixFileKey 0x28b523a "(dev=1000004,ino=113467892)"],
:isDirectory true}
So fs/attributes
fetches the file attributes, coerces it into a hash-map and keywordizes the keys as keywords.
I wonder if I should go the extra mile and keywordize the keys using camel-snake-kebab
to :creation-time
etc... not sure
Since these things also go into (fs/set-attribute "file" "basic:creationTime")
, might better not change it too much from the originalE.g.:
user=> (-> (fs/set-attribute "/tmp/foo.clj" "basic:lastModifiedTime" (fs/millis->file-time 100)) (fs/read-attributes "*") :lastModifiedTime fs/file-time->millis)
100
I think I answered my own question here, letting them stay in their original format except for string -> keyword, make sense
My pleasure 🙂
since you've mentioned it, is camel-snake-kebab and reverse funs somewhere in bb?
@i.slack you can use it as a lib from source: https://github.com/babashka/babashka/issues/463#issuecomment-766789749
ah yes, just thought it is batteries included and i've missed it. thx.