[armedbear-devel] Commit for bug with spaces in directory on trunk

Mark Evenson evenson at panix.com
Mon Nov 29 08:57:03 UTC 2010

On Nov 28, 2010, at 23:28 , Erik Huelsmann wrote:

> Hi Mark,
> You asked me to verify on Windows too. Having updated to the latest
> and greatest of trunk, I see that I'm now able to run ABCL from a path
> with spaces in them, so far so good. However, you said we require
> spaces to be %-encoded in pathnames now. Or was that in [jar:]file:
> pathnames only?
> Because, when I do (DIRECTORY #p"") from "D:\abcl\my docs", I see
> (#P"D:/abcl/my docs/")
> which is not a file: pathname, so it's to be expected

Correct, it is the behavior I expect.

Perhaps another few sentences of explanation might help everyone
check my reasoning:

The underlying Lisp PATHNAME has no concept of URI encoding, so all
characters "represent themselves". A problem arises in the places
within the ABCL FASL loading routines where we get a java.net.URL
that we need to interpret as a PATHNAME.   If this URL represents
a filepath, i.e. has the scheme "file", it is URI encoded according
to RFC3986 (actually probably RFC2396, but the two should be identical
from what I can tell). To be consistent, I implemented changes so that
all input to the PATHNAME routines using a namestring containing
the "file" scheme are decoded as URI encodings, mainly meaning that
sequences of the form '%[hexdigit][hexdigit]' are translated to the
corresponing ISO-8895-1 character.  When a namestring is output
that contains the "file" scheme, we encode as a URI.  Currently,
the only case we output a "file" scheme in namestrings is when we
compute the value for an entry in a JAR contained on the local
filesystem, i.e. 

  CL-USER> #p"jar:file:/dir%20with%20spaces/some.jar!/foo.lisp"

  CL-USER> #p"file:/dir%20with%20spaces/some.jar" "/dir with

We could maybe implement a special variable like *PATHNAME-STRICT-URIS*
that always emits the URI encoded version, but I think that would
confuse too many people.

"A screaming comes across the sky.  It has happened before, but there is nothing to compare to it now."

More information about the armedbear-devel mailing list