Summary: std.process.execv() pass arguments to programm
           Product: D
           Version: 2.030
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos

Phobos in DMD 2.030 and DMD 1.045 on Windows XP SP3:

function std.process.execv(in string pathname, in immutable(char)[][] argv)
don't pass argv parameters to executed program correctly. First element of argv
not passed (replaced by program name, or removed).

Short example - caller.exe should run called.exe with parameters "arg1",
"arg2", "arg3", then called.exe should save passed parameters into log file:

/*** begin file caller.d */
import std.process;

void main()
  string[] args = ["arg1", "arg2", "arg3"];
  std.process.execv("called.exe", args);
/*** end file caller.d */

/*** begin file called.d */
import std.file;
import std.string;

void main(string[] args)
  string s = std.string.join(args, " ");
  std.file.write("called.log", s);
/*** end file called.d */

In Windiws XP environment called.log will contain line:
"called.exe arg2 arg3"

but expected:
"called.exe arg1 arg2 arg3"

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to