From: Alessio Stalla on
On Jul 2, 1:50 pm, p...(a)informatimago.com (Pascal J. Bourguignon)
wrote:
> Alessio Stalla <alessiosta...(a)gmail.com> writes:
> > On Jul 1, 4:38 pm, p...(a)informatimago.com (Pascal J. Bourguignon)
> > wrote:
> >> Unfortunately, conditions are somewhat underspecified in Common Lisp.
> >> To the point they're almost useless, for automatic processing or
> >> recovery.  
>
> > FWIW, in Java also there's a single exception type to signal all
> > "could not open file" situations, and it's even misnamed
> > (java.io.FileNotFoundException). A richer set of conditions - file
> > does not exist, permission denied, others? - would be nice to have,
> > but you can't go too deep in detail without creating lots of OS-
> > specific conditions.
>
> Not at all.  I spoke of a exceptional situation _ontology_.  This is
> something that can and should be made as general as possible.
>
> The problem here, that you're pointing out by saying "OS-Specific" is
> that programmers usually signal conditions that are actually the state
> of the program when the exceptional situation is encountered.
> Basically, they do (ERROR (cons source-file line-number)).
>
> They should actually identify the ontological situation and signal
> that.

That is true for all applications and libraries, but here we're
talking specifically about "can't open file" conditions. If you want
to represent as conditions all the ways a call to OPEN can fail,
you'll find yourself defining conditions which are specific to a given
OS - e.g., as the OP said in another post, LOOP-IN-SYMBOLIC-LINK. Such
conditions would belong more in a POSIX or Win32 library than in CL
the language.

Alessio
From: Thomas A. Russ on
Teemu Likonen <tlikonen(a)iki.fi> writes:

> OK. Fortunately, for me it's usually enough to detect the difference
> between non-existing file and other file errors.

In that case, a workaround solution would be to just use PROBE-FILE
before calling the other file operations.

--
Thomas A. Russ, USC/Information Sciences Institute