Re: Downloading a file from a URL from the web with http-get

2014-08-15 Thread 白熊


On 2014年8月4日 18:57:57 CEST, Dmitry Bogatov  wrote:
>So here is example for other url:
>
>   (use-modules ((web uri) #:select (string->uri))
>((web client) #:select (http-get)))
>   (use-modules (rnrs io ports))
>
>   (define *url*
> "http://hackage.haskell.org/package/HaTeX-2.1.3/HaTeX-2.1.3.tar.gz";)
>
>   (call-with-values
>   (lambda () (http-get (string->uri *url*)))
> (lambda (res-headers res-body)
>   (with-output-to-file "some.tar.gz"
> (lambda () (put-bytevector (current-output-port) res-body))
> #:binary #t)))

Is there a way to use similar syntax to download ftp files? 
I can successfully download only http:// files this way. 
--
白熊




Re: Downloading a file from a URL from the web with http-get

2014-08-15 Thread Mike Gran


> On Friday, August 15, 2014 11:16 AM, 白熊  wrote:
> Is there a way to use similar syntax to download ftp files? 
> I can successfully download only http:// files this way. 


I don't know if anyone has a pure Scheme code solution to handle FTP.

There was once a binding to the libcurl library that could do FTP and TFTP,
but it would requiring compiling and installing a binary extension.  So, it
is not very convenient.  But, there's some info here:

http://www.lonelycactus.com/guile-curl.html

I haven't tried it lately, though.

-Mike


> 
> --
> 白熊
>



Re: Downloading a file from a URL from the web with http-get

2014-08-15 Thread Mario Domenech Goulart
Hi,

On Fri, 15 Aug 2014 13:46:46 -0700 Mike Gran  wrote:

>> On Friday, August 15, 2014 11:16 AM, 白熊  wrote:
>> Is there a way to use similar syntax to download ftp files? 
>> I can successfully download only http:// files this way. 
>
> I don't know if anyone has a pure Scheme code solution to handle FTP.
>
> There was once a binding to the libcurl library that could do FTP and TFTP,
> but it would requiring compiling and installing a binary extension.  So, it
> is not very convenient.  But, there's some info here:
>
> http://www.lonelycactus.com/guile-curl.html
>
> I haven't tried it lately, though.

There's a pure Scheme implementation for CHICKEN [1].  Maybe it can be
ported to Guile.  I haven't used it, though, so I can't tell you about
its working status.

[1] http://wiki.call-cc.org/egg/ftp (code here:
http://bugs.call-cc.org/browser/release/4/ftp/trunk/ftp.scm).

Best wishes.
Mario
-- 
http://parenteses.org/mario



Using guile-ssh

2014-08-15 Thread R Sidhu
I am interested in using guile-ssh for file transfer. Ran into the
following issues:

1. 'git clone
https://github.com/artyom-poptsov/guile-ssh/releases/tag/v0.6.0' fails with:
fatal:
https://github.com/artyom-poptsov/guile-ssh/releases/tag/v0.6.0/info/refs
not valid: is this a git repository?

2. INSTALL file suggests './configure' but its missing

3. Installation instructions in doc/ directory (texinfo files) suggest
'autoreconf -if' which fails with:
configure.ac:55: error: possibly undefined macro: AC_DEFINE
  If this token and others are legitimate, please use m4_pattern_allow.
  See the Autoconf documentation.
autoreconf: /usr/bin/autoconf failed with exit status: 1

4. While initial steps seem clear (establishing session, authenticating and
creating channel), not clear how to perform file transfer.

Appreciate work done on guile-ssh so far. Look forward to help re above.

Regards
sidhu1f


Automatic code formatting?

2014-08-15 Thread Bernardo Ezequiel Contreras
hi all,
  i would like to know how do you automatically format your code?
  cause i have no idea, and i don't want to do it manually.
  is there a emacs mode, command or something for that?


thanks in advance

-- 
Bernardo E.C.

Sent from a cheap desktop computer in South America.


Re: Automatic code formatting?

2014-08-15 Thread Nala Ginrut
scheme-mode is enough, I always use it.
2014年8月16日 下午12:28于 "Bernardo Ezequiel Contreras" 写道:

> hi all,
>   i would like to know how do you automatically format your code?
>   cause i have no idea, and i don't want to do it manually.
>   is there a emacs mode, command or something for that?
>
>
> thanks in advance
>
> --
> Bernardo E.C.
>
> Sent from a cheap desktop computer in South America.
>