[erlang-patches] Fix for executing external apps on win32 with a space in the filename path.

Bjorn Gustavsson bgustavsson@REDACTED
Thu Jun 11 15:16:17 CEST 2009


On Wed, Jun 10, 2009 at 11:33 PM, Blaine Whittle<BWhittle@REDACTED> wrote:
> This is a resubmission of a patch I made last year, it's been applied and tested against R13B.
> Original submission http://www.erlang.org/cgi-bin/ezmlm-cgi?3:mss:268:200808:lkalfgpohefpiajoncnd
> After reviewing my original post, it appears that the test case I listed is incorrect.   Passing a command line wrapped with double quotes to os:cmd works as expected, for example this command should work in R13B (assuming Visual Studio 2005 installed on the machine)
> os:cmd("\"C:\\Program Files\\Microsoft Visual Studio 8\\Common7\\IDE\\devenv.com\" /?").
> The real issue is with open_port.   For example, passing the same double-quote-delimited command line to open_port on R13B results in an einval exception
> open_port({spawn, "\"C:\\Program Files\\Microsoft Visual Studio 8\\Common7\\IDE\\devenv.com\" /?"},[{line, 60}, exit_status, hide, stderr_to_stdout]).

Thanks for pointing out the problem. We will correct it in R13B02.

Note that you don't have to quote the name of the executable in R13B01
if you use the newly introduced spawn_executable option for
open_port/2 described here:

http://www.erlang.org/doc/man/erlang.html#open_port-2

/Bjorn

-- 
Björn Gustavsson, Erlang/OTP, Ericsson AB


More information about the erlang-patches mailing list