<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">This seems to work better than what is currently there:<div><br></div><div><div><div>(let ((*WARN-IF-REDEFINE-KERNEL* nil))</div><div> (defun ccl::make-windows-command-line (strings)</div><div> (setf strings (mapcar 'prin1-to-string strings))</div><div> (reduce (lambda (s1 s2) (concatenate 'string s1 " " s2))</div><div> (cdr strings) :initial-value (car strings))))</div></div><div><br></div><div>rg</div><div><br></div><div><div>On Feb 14, 2014, at 7:35 AM, Loïc Maury <<a href="mailto:lmaury@gmail.com">lmaury@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">To follow the problem, can you launch on Window, for-example notepad.exe ?<div><br></div><div>I try but that doesn't work,</div><div><br></div><div>(run-program "notepad" '() :input t :output :stream)<br>
</div><div><br></div><div>and seem to be blocked for ever ?</div><div><br></div><div>if I pass an argument (the name of file), in command line for example</div><div><br></div><div>(run-program "notepad" '("foo") :input t :output :stream)<br>
</div><div><br></div><div>it ask me if I want to create it and stay blocked too.</div><div><br></div><div>However command from cygwin (touch, cat) work well.</div><div><br></div><div>On linux everything work fine.</div><div>
<br></div><div>Thank you</div><div><br></div><div>Loic</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Feb 14, 2014 at 12:10 AM, Anton Vodonosov <span dir="ltr"><<a href="mailto:avodonosov@yandex.ru" target="_blank">avodonosov@yandex.ru</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I investigated this, it's definitely a bug in CCL 1.9<br>
<br>
On CCL 1.9 on Windows, when you call ccl:run-program, it's parameter PROGRAM is preppended<br>
to the ARGS parameter to form a single list of strings, then this list is passed<br>
to ccl::make-windows-command-line to form a single command line string, and then<br>
that string is passed to CreateProcess WinAPI function as the second parameter<br>
lpCommandLine (<a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms682425(v=vs.85).aspx" target="_blank">http://msdn.microsoft.com/en-us/library/windows/desktop/ms682425(v=vs.85).aspx</a>)<br>
<br>
See linux-files.lisp in CCL sources.<br>
<br>
Suppose I want to start a program C:\Program Files (x86)\acl90express\alisp.exe<br>
without arguments.<br>
<br>
In Lisp it must be called like this:<br>
<br>
(ccl:run-program "C:<a href="smb://Program">\\Program</a> Files (x86)<a href="smb://acl90express//alisp.exe">\\acl90express\\alisp.exe</a>" '())<br>
<br>
WinAPI CreateProcess function should receive the following lpCommandLine<br>
<br>
"\"C:<a href="smb://Program">\\Program</a> Files (x86)<a href="smb://acl90express//alisp.exe/">\\acl90express\\alisp.exe\</a>""<br>
<br>
i.e. all the executable path must be surrounded by double quotes to prevent<br>
spaces in the path to be interpreted as separators.<br>
<br>
But CCL computes different thing:<br>
<br>
(format t "~A~%" (ccl::make-windows-command-line '("C:<a href="smb://Program">\\Program</a> Files (x86)\\acl90express\\alisp.exe")))<br>
=> C:\Program" "Files" "(x86)\acl90express\alisp.exe<br>
<br>
i.e. CCL surrounds every space by double quotes, instead of surrounding<br>
whole executable path.<br>
<br>
Probably we need to reopen #858 or submit a new ticket.<br>
<br>
Best regards,<br>
- Anton<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
_______________________________________________<br>
Openmcl-devel mailing list<br>
<a href="mailto:Openmcl-devel@clozure.com">Openmcl-devel@clozure.com</a><br>
<a href="http://clozure.com/mailman/listinfo/openmcl-devel" target="_blank">http://clozure.com/mailman/listinfo/openmcl-devel</a><br>
</div></div></blockquote></div><br></div>
</blockquote></div><br></div></body></html>