From: Joe Marshall
Subject: pathname nitpicking
Date: 
Message-ID: <wu2y4xg6.fsf@comcast.net>
There's a fair amount of wiggle room in the pathname specification for
all sorts of unsavory behavior, but this one seems pretty clear.  In
PROBE-FILE, the hyperspec says

  `An error of type file-error is signaled if pathspec is wild.'

This implies that if probe-file completes without an error, then the
pathspec is not wild.  If a file-error *is* signaled, then one reason
may be because the pathspec is wild (assuming a conforming
implementation, of course).

In DIRECTORY, the hyperspec says

  `If the pathspec is not wild, the resulting list will contain either
   zero or one elements.'

The word `wild' in both places has a hyperlink to the same glossary entry.

Therefore, given a pathspec if PROBE-FILE does not signal an error of
type file-error, then DIRECTORY of that pathspec should return a list
of either zero or one elements.  (Assuming that neither probe-file nor
directory raise an error.)

CLisp seems to conform in this regard, but Lispworks fails.

It is unfortunate that there are pathspecs which are wild (DIRECTORY
returns two or more elements) for which WILD-PATHNAME-P returns NIL,
but the hyperspec doesn't require WILD-PATHNAME-P to detect *all* wild
pathnames.  (There seems to be a bit of confusion.  A pathname with a
:wild component or with a string component containing implementation
and/or platform specific characters is `wildcarded' and is definitely
a `wild' file, but this leaves open the possibility of some other
way to have a wild file.)

-- 
~jrm