Re: any lisper out there?

Luke Tierney <[email protected]> Thu, 30 May 2002 10:14:37 -0500
Newsgroups gmane.lisp.statistics
Message-ID <[email protected]>
ERRSET is a non-standard, low level procedure.  It's better to use the
condition system.  Either

> (ignore-errors (rename-file "foo" "bar"))
NIL
#<Condition SIMPLE-ERROR: 817abb0>


or

> (handler-case (rename-file "foo" "bar")
                (error (e) e))
#<Condition SIMPLE-ERROR: 81d6f30>
> (princ *)
can't rename file - "foo"
#<Condition SIMPLE-ERROR: 81d6f30>

luke

On Thu, May 30, 2002 at 04:43:03PM +0200, Frederic Udina wrote:
> 
> Hi silent lispers,
> 
> I have a problem and seek for a solution.
> 
> Within of a lisp program,
> I want to copy a file from the current directory to a system directory.
> It could be the case (it is often) that the system directory is
> write-protected and so (rename-file old new) gives an error.
> 
> How can I prevent the error? Is the function ERRSET working? Does it
> anything useful?
> 
> ERRSET
> [function-doc]
> Args: (expr [pflag])
> Traps errors occurring during the evaluation of EXPR. PFLAG controls
> printing
> of the error message. Returns the value of the last expression consed with
> NIL or NIL. 
> 
> Any clue?
> 
> 
>  Frederic Udina
>   ____________________________________________________________________
>   <[email protected]> Dept. D'Economia i Empresa   Universitat Pompeu Fabra
>                   Ramon Trias Fargas, 25-27      08005 Barcelona SPAIN
>   tel. 34- 935421756/1763 fax: 34- 935421746     http://libiya.upf.es/
>   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>   There are many here among us who feel that life is but a joke  B.Dy.
> 

-- 
Luke Tierney
University of Minnesota                      Phone:           612-625-7843
School of Statistics                         Fax:             612-624-8868
313 Ford Hall, 224 Church St. S.E.           email:      [email protected]
Minneapolis, MN 55455 USA                    WWW:  http://www.stat.umn.edu