process
process copied to clipboard
Support :out :bytes
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