How to set workDir for std.process.execute ?
KrzaQ via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Wed Aug 20 09:07:47 PDT 2014
Hello,
I'm trying to follow the documentation:
http://dlang.org/phobos/std_process.html#.execute
Unfortunately, the following code gives me a compiler error:
class Probator
{
char[] dir;
this(const char[] dir){
this.dir = dir.dup;
}
int revision(){
import std.process;
import std.conv;
const char[] workDir = "~".dup;
auto p = std.process.execute(["svnversion", dir], null,
Config.none, size_t.max, workDir);
if(p.status == 0){
return to!int(p.output);
}else{
throw new Exception(p.output);
}
}
}
error:
/d629/f876.d(15): Error: function std.process.execute
(const(char[][]) args, const(immutable(char)[][string]) env =
null, Config config = cast(Config)0, ulong maxOutput =
18446744073709551615LU) is not callable using argument types
(const(char)[][], typeof(null), Config, ulong, const(char[]))
It's as if the implementation didn't expect the last argument.
More information about the Digitalmars-d-learn
mailing list