The new std.process is ready for review
H. S. Teoh
hsteoh at quickfur.ath.cx
Tue Feb 26 07:06:51 PST 2013
On Tue, Feb 26, 2013 at 09:22:11AM -0500, Steven Schveighoffer wrote:
[...]
> I just reread the docs, considering Vladimir's point about
> space-containing no-arg programs. I agree there is a problem.
>
> We need to not get rid of the single program version of spawn, we
> need to simply interpret it as a no-arg program.
>
> To have this not work:
>
> spawnProcess("c:/Program Files/xyz/xyz.exe");
>
> and require this instead:
>
> spawnProcess("c:/Program Files/xyz/xyz.exe", []);
>
> is not very intuitive.
>
> It reminds me of when we had writefln and not writeln, in order to
> print out a string with % in it, you had to do writefln("%s", "%s");
[...]
I agree. I think the onus should be on the user to call std.array.split
(or equivalent) if he wants to have arguments split on whitespace. Like
this:
spawnProcess(split("dmd -O myprogram.d mymodule.d"));
Not much of a difference in usability, but prevents nasty gotchas like
cited above. I vote for spawnProcess to never automatically split on
whitespace.
T
--
Real Programmers use "cat > a.out".
More information about the Digitalmars-d
mailing list