www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Is this a bug in execvp of std.process

reply Cheng Wei <rivercheng gmail.com> writes:
#import std.process
void main() {
    execvp("ip", "route");
}

result:
Object "ute" is unknown, try "ip help".

That is the first two bytes are lost

Adding two spaces works:
#import std.process
void main() {
    execvp("ip", "  route");
}

Version 2.055, linux, 32bit

Thanks.
Sep 20 2011
parent "Steven Schveighoffer" <schveiguy yahoo.com> writes:
On Wed, 21 Sep 2011 00:30:11 -0400, Cheng Wei <rivercheng gmail.com> wrote:

 #import std.process
 void main() {
     execvp("ip", "route");
 }

 result:
 Object "ute" is unknown, try "ip help".

 That is the first two bytes are lost

 Adding two spaces works:
 #import std.process
 void main() {
     execvp("ip", "  route");
 }

 Version 2.055, linux, 32bit

 Thanks.
Definitely a bug, but likely one that will not be fixed. std.process has been rewritten, and the result is waiting for a change to the Windows C runtime (dmc) for supporting pipes. However, you are on Linux, so you can probably use the updated std.process see here: https://github.com/kyllingstad/phobos/tree/new-std-process You will likely have to do some git cloning to get these into the latest phobos. -Steve
Sep 22 2011