Hi guile community,

I’m a new user, jumping into guix and guile in the same time,
i’m interested to build a module to download file stored on Zenodo platform, 
using curl to request their REST Api.

This is usefull for reproducibility, i need to recover some data from Zenodo 
before running guix package that compile simulation that use this data.

I built a first part, using some info i found about curl lib of guile, but i’m 
now blocked by the last part, writing the binary body retrieved by curl into 
some file on my disk.

Here the full script  on debian paste :  <https://paste.debian.net/1248702/>

My problem is probably here, i don’t know how to pass the byte of body (from 
(get-file get-file-link)) into some file, i try with and without 
“string->bytevector” body conversion, without success  :

;; report body content from url string
(define (get-file url)
  ((receive (response body) (http-get url #true) (string->bytevector body))))

;; write content into file
(call-with-output-file “download.zip” (lambda (current-output-port)
                                        (get-file get-file-link)
                                        (put-bytevector (current-output-port) 
body)))

Thanks for your help
Best regards,
S.RC.

Attachment: signature.asc
Description: PGP signature

Reply via email to