[armedbear-devel] Spaces in pathnames (jar:file:/x/y/z/a space/...)

Theam Yong Chew senatorzergling at gmail.com
Wed Feb 16 13:34:09 UTC 2011


On 2/16/11, Mark Evenson <evenson at panix.com> wrote:
> On 2/15/11 10:37 PM, Theam Yong Chew wrote:
>> Dear ABCL developers,
>>
>> While ABCL can handle spaces (&  others) in file pathnames just fine, a
>> space in jar file pathnames still doesn't work. I have confirmed this
>> on Linux, Mac and Windows. An example using Cygwin,
>
> […]
>
> When a Pathname starts using URI scheme identifiers like 'jar', the
> strings are then required to obey URI encoding rules.  So try replacing
> #\Space characters with the string "%20".
>
>
> #<THREAD "interpreter" {9AC0F5}>: Debugger invoked on condition of
>> type FILE-ERROR
>>    Failed to create URI from 'e:/My Dropbox/temp/a space/hello.jar':
>> Illegal character in opaque part
>>   at index 10: file:e:/My Dropbox/temp/a space/hello.jar
>> Restarts:
>>    0: TOP-LEVEL Return to top level.
>>
>
> […]

Sorry Mark, I was going to add some more clarification to my original
email, but you were too quick to reply! The above error message was
actually slightly different from how I originally stumbled on the
problem, which looked somewhat like this:

[1] CL-USER(1): (load
"jar:file:/home/tyc20/Dropbox/temp/a%20space/hello.jar!/hello.abcl")
#<THREAD "interpreter" {12C9557}>: Debugger invoked on condition of
type FILE-ERROR
  Loadable FASL not found for
'jar:file:/home/tyc20/Dropbox/temp/a%20space/hello.jar!/hello.abcl' in
'jar:jar:file:/home/tyc20/Dropbox/temp/a%2520space/hello.jar!/hello.abcl!/hello._'
Restarts:
  0: ABORT Return to debug level 1.

In fact, originally, I encountered this from the command line like so:

java -cp abcl.jar:....   org.armedbear.lisp.Main --load
'jar:file:main.jar!/main.abcl'

So there weren't even any obvious spaces, since I only provided
relative paths.

So to clarify, it wasn't a "Failed to create URI" error, but a
"Loadable FASL not found" error.

> Try with the URI escaped version, i.e.
> "jar:file:e/My%20Dropbox/temp/a%20spac/hello.jar!/hello.abcl", instead.

Yes, the original error message I had showed just such an escape
sequence, but I wasn't sure what to make of it! For simple folks like
me, if we load "/home/..."  as a file, it's not a URL (and does not
require escaping), whereas the jar: path uses URL 'encoding'. Would
that be right? (Simplifying of course)

> A quick glance through the [ABCL JAR-PATHNAME specification][1] shows
> that it doesn't explicity mention this design.  Implicitly, since a
> JAR-PATHNAME is a URI-PATHNAME it has to obey the [URI-PATHNAME
> rules][2], but we could certainly make things clearer.
>
> [1]:
> http://trac.common-lisp.net/armedbear/browser/trunk/abcl/doc/design/pathnames/jar-pathnames.markdown
>
> [2]:
> http://trac.common-lisp.net/armedbear/browser/trunk/abcl/doc/design/pathnames/url-pathnames.markdown
>
> We tried to make the Lisp reader friendly is this regard by DWIMing a
> String inputs into Pathname, but if you find an unambiguous case that
> could be improved to be friendly, we would solicit a specification or
> patches.


Not sure what you mean here, but just being aware of the difference
between jar and normal file-paths (vis a vis URL vs "plain strings")
would be more than sufficient I feel. I vaguely knew about the URL
stuff, but must have discounted it due to heavy use of the normal
pathname form in ABCL.

Thanks, and sorry for the confusion. I hope this error is clear enough
this time, and is reproducible.

Yong.


> Enjoy the bear!

Yes, very much so!




More information about the armedbear-devel mailing list