This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-02-05
Channels
- # announcements (16)
- # babashka (10)
- # beginners (80)
- # calva (18)
- # cider (10)
- # clojure (96)
- # clojure-austin (1)
- # clojure-europe (52)
- # clojure-france (6)
- # clojure-germany (2)
- # clojure-italy (4)
- # clojure-nl (4)
- # clojure-seattle (3)
- # clojure-spec (4)
- # clojure-uk (25)
- # clojurescript (97)
- # community-development (2)
- # cursive (7)
- # datomic (13)
- # figwheel-main (5)
- # fulcro (13)
- # inf-clojure (1)
- # jobs (3)
- # off-topic (33)
- # pathom (10)
- # polylith (8)
- # re-frame (7)
- # reitit (8)
- # releases (1)
- # reveal (2)
- # ring (4)
- # ring-swagger (1)
- # sci (6)
- # shadow-cljs (102)
- # slack-help (1)
- # spacemacs (28)
- # tools-deps (9)
- # vim (1)
- # xtdb (3)
@neo2551 cider-pprint now works in the babashka nrepl server from master (also see #babashka_circleci_builds). Thanks @grazfather
Works great, thanks @grazfather
My pleasure 🙂
Great! Thanks!
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
👍 3
@i.slack you can use it as a lib from source: https://github.com/babashka/babashka/issues/463#issuecomment-766789749