Fork me on GitHub
#clojure-europe
<
2023-05-13
>
jasonbell15:05:52

Is there a nicer way of doing a binary file copy instead of having one io/input-stream into a io/output-stream?

potetm15:05:57

Pretty sure io/copy supports files

potetm15:05:41

It does. > Copies input to output. Returns nil or throws IOException. > Input may be an InputStream, Reader, File, byte[], char[], or String. > Output may be an OutputStream, Writer, or File.

jasonbell16:05:29

Thanks @UK0810AQ2 @U07S8JGF7 - I did try io/copy but the file sizes were different after the copy. I’ll take another look.

borkdude16:05:27

(require '[babashka.fs :as fs])
(fs/copy (fs/file "1") (fs/file "2"))

borkdude16:05:55

(this library isn't specific to bb, it runs in the JVM as intended)

👍 2
jasonbell15:05:10

Feeling a bit rusty on this for some reason.

delaguardo17:05:57

📷 10
❤️ 2
😍 2
genmeblog19:05:08

Morning/evening

6
😍 2