Fork me on GitHub
#babashka
<
2021-02-05
>
borkdude08:02:18

@neo2551 cider-pprint now works in the babashka nrepl server from master (also see #babashka_circleci_builds). Thanks @grazfather

solf09:02:36

Works great, thanks @grazfather

grazfather15:02:24

My pleasure 🙂

David Pham08:02:40

Great! Thanks!

borkdude10:02:24

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 original

borkdude10:02:11

E.g.:

user=> (-> (fs/set-attribute "/tmp/foo.clj" "basic:lastModifiedTime" (fs/millis->file-time 100)) (fs/read-attributes "*") :lastModifiedTime fs/file-time->millis)
100

borkdude10:02:45

I think I answered my own question here, letting them stay in their original format except for string -> keyword, make sense

👍 1
Dig16:02:15

since you've mentioned it, is camel-snake-kebab and reverse funs somewhere in bb?

Dig16:02:18

ah yes, just thought it is batteries included and i've missed it. thx.