fs
fs copied to clipboard
File system utility library for Clojure
I've been wanting to use babashka.fs for writing files using nio * for byte arrays https://docs.oracle.com/javase/7/docs/api/java/nio/file/Files.html#write(java.nio.file.Path,%20byte[],%20java.nio.file.OpenOption...) * and chars https://docs.oracle.com/javase/7/docs/api/java/nio/file/Files.html#write(java.nio.file.Path,%20java.lang.Iterable,%20java.nio.charset.Charset,%20java.nio.file.OpenOption...) Might supporting those be a sensible addition? Would also require...
E.g.: ``` clojure (fs/zip "foo.zip" [{:path "foo/bar/baz" :root "foo/bar"}]) ``` TODO: look at how Python, Ruby and Node.js do this and also clj-commons/fs. Alternative 1: provide a function to do...
Java Files allows for copying an InputStream (such as one from an http request) to disk via Files/copy . babashka.fs/copy does not allow this. https://docs.oracle.com/javase/8/docs/api/java/nio/file/Files.html#copy-java.io.InputStream-java.nio.file.Path-java.nio.file.CopyOption...-
heow Today at 3:42 PM anyone know the permissions format for (fs/create-dir "foo") ? The docs just reference Files which is a bit opaque 3 replies borkdude:clj-kondo: 3 minutes ago...
I find myself needing temp-file just to create a temporary file somewhere.
Do we need this? When moving a file on the same partition, moving an entire dir should already work. Workaround: copy-tree + delete-tree on the original.
find-up
Issue https://github.com/babashka/fs/issues/112 Applied to [clj-kondo](https://github.com/clj-kondo/clj-kondo/compare/master...eval:clj-kondo:upgrade-fs). ## considerations - currently raises on `start` not existing (as fs/parent happily traverses up existing or not) - maybe this should be configurable (seems needed...
I see a couple of places in the code, where OS support is hardwired for `babashka.fs/file-separator`. It could be made more flexible, if we would use a filesystem specific separator,...
When writing bb-scripts operating on files I often find myself writing code related to A) finding a specific file that I'm sure exists in CWD or a parent folder (e.g....
Hello, I stumbled over the following problem when trying to copy a sub-tree with `copy-tree` from a jar resources to the the file system. You can reproduce the error with...