[Openmcl-devel] Run-program on windows with path names containing spaces

Anton Vodonosov avodonosov at yandex.ru
Thu Feb 13 15:10:40 PST 2014


I investigated this, it's definitely a bug in CCL 1.9

On CCL 1.9 on Windows, when you call ccl:run-program, it's parameter PROGRAM is preppended
to the ARGS parameter to form a single list of strings, then this list is passed
to ccl::make-windows-command-line to form a single command line string, and then
that string is passed to CreateProcess WinAPI function as the second parameter 
lpCommandLine (http://msdn.microsoft.com/en-us/library/windows/desktop/ms682425(v=vs.85).aspx)

See linux-files.lisp in CCL sources.

Suppose I want to start a program C:\Program Files (x86)\acl90express\alisp.exe
without arguments.

In Lisp it must be called like this:

  (ccl:run-program "C:\\Program Files (x86)\\acl90express\\alisp.exe" '())

WinAPI CreateProcess function should receive the following lpCommandLine

  "\"C:\\Program Files (x86)\\acl90express\\alisp.exe\""

i.e. all the executable path must be surrounded by double quotes to prevent
spaces in the path to be interpreted as separators.

But CCL computes different thing:

  (format t "~A~%" (ccl::make-windows-command-line '("C:\\Program Files (x86)\\acl90express\\alisp.exe")))
  => C:\Program" "Files" "(x86)\acl90express\alisp.exe 

i.e. CCL surrounds every space by double quotes, instead of surrounding
whole executable path.

Probably we need to reopen #858 or submit a new ticket.

Best regards,
- Anton

  




More information about the Openmcl-devel mailing list