sci

jyn 2025-07-27T19:01:56.100729Z

when i run (.getFileName (fs/path "my-path.clj")) in a clojure repl it works fine, but when i run the same in an SCI interpreter, it gives this error:

Method getFileName on class sun.nio.fs.UnixPath not allowed!

✅ 1
jyn 2025-07-27T19:02:31.880309Z

why does that happen? this shouldn't need to interact with the host filesystem, i wouldn't think?

✅ 1
borkdude 2025-07-27T19:03:13.527059Z

You need to configure SCI for interop explicitly

borkdude 2025-07-27T19:03:33.086969Z

Are you on the JVM or in a native image?

jyn 2025-07-27T19:03:47.865869Z

oh i see

jyn 2025-07-27T19:03:54.727719Z

i am currently on the JVM but i plan to use Graal eventually

jyn 2025-07-27T19:04:07.293399Z

i missed <https://github.com/babashka/sci/tree/master?tab=readme-ov-file#classes> in the readme

jyn 2025-07-27T19:05:15.315369Z

i think fs/file-name is what i want, then i don't need to worry about interop

borkdude 2025-07-27T19:05:50.217999Z

Check babashka’s src/babashka/impl/classes.clj for bb’s classes config. Yeah it’s better to just add functions

👍 1