digitalmars.D.learn - using std.process
- Philippe Sigaud (11/11) Jun 11 2010 OK, this is a real newbie question:
- Graham Fawcett (5/21) Jun 11 2010 Try giving an absolute path to 'mkdir'. I'm fairly sure that the exec*
- BCS (7/26) Jun 11 2010 That's what the 'p' in 'vp' stand for: path.
- Philippe Sigaud (21/28) Jun 12 2010 I tried the different versions and used execvp precisely because it's
OK, this is a real newbie question: How can I use std.process? when I do: import std.process; void main() { execvp("mkdir", ["test"]); } nothing happens. What am I doing wrong? I'm on Vista there, didn't try the equivalent under Linux. Philippe
Jun 11 2010
On Fri, 11 Jun 2010 19:09:04 +0000, Philippe Sigaud wrote:OK, this is a real newbie question: How can I use std.process? when I do: import std.process; void main() { execvp("mkdir", ["test"]); } nothing happens. What am I doing wrong? I'm on Vista there, didn't try the equivalent under Linux.Try giving an absolute path to 'mkdir'. I'm fairly sure that the exec* family does not use the PATH environment. Best, Graham
Jun 11 2010
Hello Graham,On Fri, 11 Jun 2010 19:09:04 +0000, Philippe Sigaud wrote:That's what the 'p' in 'vp' stand for: path. OTOH I don't remember if the exec's tack on the exe name to the args so you might need to do: execvp("mkdir",["mkdir","test"]); -- ... <IXOYE><OK, this is a real newbie question: How can I use std.process? when I do: import std.process; void main() { execvp("mkdir", ["test"]); } nothing happens. What am I doing wrong? I'm on Vista there, didn't try the equivalent under Linux.Try giving an absolute path to 'mkdir'. I'm fairly sure that the exec* family does not use the PATH environment.
Jun 11 2010
GrahamTry giving an absolute path to 'mkdir'. I'm fairly sure that the exec*I tried the different versions and used execvp precisely because it's supposed to provide the path. But I admit I never tried giving it an entire path. BCS:family does not use the PATH environment.That's what the 'p' in 'vp' stand for: path. OTOH I don't remember if the exec's tack on the exe name to the args so you might need to do: execvp("mkdir",["mkdir","test"]);*** Ok, I tried your suggestions and obtained some results. Right now, I can even make dmd compile some simple file, like this: execvp("dmd", ["dmd", "test.d"]; It doesn't do anything with just execvp("dmd", ["test.d"]); Now, my goal is to activate the dot executable from graphviz ( http://www.graphviz.org ) and... it works if I use execvp("dot", ["dot", /* arg lis */]); thank to you both! strangely, it takes 22s to produce the pdf, as opposed to about 3s at the command line... I think initially, I stopped it before it could finish its work. Philippe
Jun 12 2010