From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?UTF-8?B?55m954aK?= Newsgroups: gmane.lisp.guile.user Subject: Downloading a file from a URL from the web with http-get Date: Mon, 04 Aug 2014 12:12:03 +0400 Message-ID: <956cfbf0-ab9a-434f-bf45-14872a5084f6@email.android.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1407139968 25451 80.91.229.3 (4 Aug 2014 08:12:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 4 Aug 2014 08:12:48 +0000 (UTC) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Mon Aug 04 10:12:41 2014 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XEDNo-0000oW-Ia for guile-user@m.gmane.org; Mon, 04 Aug 2014 10:12:40 +0200 Original-Received: from localhost ([::1]:50838 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEDNn-0003IJ-Mq for guile-user@m.gmane.org; Mon, 04 Aug 2014 04:12:39 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37276) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEDNZ-0003Hv-NH for guile-user@gnu.org; Mon, 04 Aug 2014 04:12:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XEDNT-0002ul-QW for guile-user@gnu.org; Mon, 04 Aug 2014 04:12:25 -0400 Original-Received: from deleuze.hcoop.net ([69.90.123.67]:42714) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEDNT-0002op-NA for guile-user@gnu.org; Mon, 04 Aug 2014 04:12:19 -0400 Original-Received: from [195.239.33.7] (helo=[192.168.1.100]) by deleuze.hcoop.net with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1XEDNM-0001VW-Ir for guile-user@gnu.org; Mon, 04 Aug 2014 04:12:12 -0400 User-Agent: K-9 Mail for Android X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 69.90.123.67 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:11367 Archived-At: Hello everybody: I'm learning Guile=2E I'd like to write a utility, which will enable me up= on user input download program sources from the web, i=2Ee=2E not a web-spi= der, but download discrete URL's and save them to disk=2E I've looked at: http://lists=2Egnu=2Eorg/archive/html/guile-user/2012-04/msg00032=2Ehtml http://lists=2Egnu=2Eorg/archive/html/guile-user/2012-05/msg00005=2Ehtml so the possibility to do, seems to be there=2E Specifically, let's say, I want to download: http://ftp=2Egnu=2Eorg/pub/gnu/guile/guile-2=2E0=2E11=2Etar=2Exz and save it to ~/ How should I modify the following code to do this?: (use-modules ((web uri) #:select (string->uri)) ((web client) #:select (http-get))) (call-with-values (lambda () (http-get (string->uri "http://www=2Egnu=2Eorg/software/guile= /"))) (lambda (res-headers res-body) (display res-body) (newline))) i=2Ee=2E not display the body, but save it to file? Or is the above only a= pplicable to text responses - webpages, and not for binary files? Thanks very much for any help=2E -- =E7=99=BD=E7=86=8A