[Openmcl-devel] Hi from new user

Gary Byers gb at clozure.com
Tue Feb 24 02:06:15 PST 2009



On Mon, 23 Feb 2009, Denis Bodyak wrote:

> Hi Gary, Ray, list!
>
>> If that's the bug, then just doing:
>>
>> ? (run-program "svn" '("info") :output t)
> It looks like that... It looks like I didn't restart my cmd.exe after installing adding svn to a path.
>
>> Yes.  The printed representation of a pathname (and the result
>> of the function NAMESTRING) will escape/quote dots that are
>> constituents of the pathname's name or type components (as opposed
>> to a dot that separates these components.)  When a string is coerced
>> to a pathname, escaped dots are interpreted as constituents.
> Ok, but I see no way to address md5.asd.lnk at all . ' is not a quoting character under win32 so this is evidently a bug.

I don't understand either of those sentences.

>
>> I believe that it reads as #\a,#\Return,#\Newline,#\b, which would
>> be exactly what the console sent (where #\Newline is also known as
>> #\Linefeed).
> Yes, I was wrong, sorry. I thought it returns #\Return instead of #\Newline, and didn't even check that third element exist. It returns #\a,#\Return,#\Newline,#\b.
>
> But
>
> (with-input-from-string (s "a
> b") (read-line s))
> returns a string of #\a,#\Return. This causes odd printing:
> "a
> NIL
> - no closing double-quote is printed at all. This would be ok too. But I use GNU's readlink.exe to resolve *.asd.lnk to *.asd (as asdf does on linux).
>
> Here readlink returns (I guess)
> "l:/clbuild/source/md5/md5.asd
> "
> (here I guess we have #\Return and #\Newline).
> Then I use readline (as you do in case of svn-info-component) and I get a filename with #\Return in the end of it. I have to remove it manually to get correct filename.
>

We are in agreement that the #\Return in the CRLF causes problems and should
be stripped out (long before READ-LINE or READ-CHAR would see it.)

>> I'm trying to force myself to actually use Windows without using
> Cygwin.
> Are things easier in ccl with cygwin? If so, I can just install it.
> Especially if this could help solve md5.asd.lnk issue.
>

What is the md5.asd.lnk issue ?

One consequence of the escaping is that you can't just pass a
lisp namestring to foreign code:

(with-cstrs ((cname (namestring (truename path))))  ; wrong: result may contain escaped characters
   (#_do_something cname))

(with-cstrs ((cname (ccl::native-translated-namestring path)))
   (#_do_something cname))

That's pretty ugly; something imported and documented like:

(with-native-foreign-namestring ((cname path))
   ;; todo: pathname encoding, etc.
   (#_whatever name))

is a bit less so.

Cygwin introduces its own set of problems (for example, if a non-Cygwin
process is running under a Cygwin shell, a ^C terminates that process.)

Most (all?) Cygwin utilities just use LF (not CRLF), so all of the
issues related to line termination can be ignored.  (perhaps for a
little too long.)

> Thanks for detailed reply :)
>
>



More information about the Openmcl-devel mailing list