process icon indicating copy to clipboard operation
process copied to clipboard

Support :out :bytes

Open borkdude opened this issue 4 years ago • 0 comments

It would be nice if we could download binary files like so:

(def response (-> (process ["curl" "--progress-bar" "http://ipv4.download.thinkbroadband.com/200MB.zip"] {:out bytes :err :inherit}) deref :out))

and the response would be a byte array.

Note that we can do this currently with:

user=> (def response (-> (process ["curl" "--progress-bar" "http://ipv4.download.thinkbroadband.com/200MB.zip"] {:out byte-stream :err :inherit}) deref :out))
######################################################################## 100.0%
#'user/response
user=> (type response)
java.io.ByteArrayOutputStream
user=> (count (.toByteArray response))
209715200
user=> (/ 209715200 1024 1024)
200

borkdude avatar Feb 10 '21 22:02 borkdude