scsh-users
[Top] [All Lists]

Re: sunet(FTP) not working (Interrupted system call). the patch helps,

To: mmc@maruska.dyndns.org (Michal Maruška)
Subject: Re: sunet(FTP) not working (Interrupted system call). the patch helps, but
From: Eric Marsden <emarsden@laas.fr>
Date: Sun, 17 Mar 2002 19:32:15 +0100
Cc: scsh-news <scsh-news@zurich.ai.mit.edu>
Organization: LAAS-CNRS http://www.laas.fr/
Sender: Eric Marsden <emarsden@melbourne.laas.fr>
>>>>> "mm" == Michal Maruška <mmc@maruska.dyndns.org> writes:

  mm> now it works! Thanks.  The ftp:get terminates succesfully.
  mm> But still ftp:ls and ftp:dir raise:
  mm> 
  mm> Error: exception
  mm> wrong-type-argument
  mm> (string-length '())

hmm, it seems that let-optionals* has changed. The attached patch
(which includes the previous one) fixes this.

BTW, here is an example of how you can write code to handle errors
that are signaled as ftp:error.

    (define (with-ftp-error-handler* thunk)
      (call-with-current-continuation
       (lambda (k)
         (with-handler
          (lambda (condition next)
            (cond ((eq? 'ftp:error (car condition))
                   (format #t "FTP error signaled: ~a~%" (cadr condition)))
                  (else (next))))
          thunk))))
    
    (define-syntax with-ftp-error-handler
      (syntax-rules ()
        ((with-ftp-error-handler ?body ...)
         (with-ftp-error-handler* (lambda () ?body ...)))))
    

Attachment: sunet-ftp.diff
Description: Text Data

-- 
Eric Marsden                          <URL:http://www.laas.fr/~emarsden/>
<Prev in Thread] Current Thread [Next in Thread>