Thread overview
How to set workDir for std.process.execute ?
Aug 20, 2014
KrzaQ
Aug 20, 2014
ketmar
Aug 20, 2014
krzaq
August 20, 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.
August 20, 2014
On Wed, 20 Aug 2014 16:07:47 +0000
KrzaQ via Digitalmars-d-learn <digitalmars-d-learn@puremagic.com> wrote:

> It's as if the implementation didn't expect the last argument.
try to upgrade to dmd 2.066.


August 20, 2014
On Wednesday, 20 August 2014 at 16:16:03 UTC, ketmar via Digitalmars-d-learn wrote:
> On Wed, 20 Aug 2014 16:07:47 +0000
> KrzaQ via Digitalmars-d-learn <digitalmars-d-learn@puremagic.com> wrote:
>
>> It's as if the implementation didn't expect the last argument.
> try to upgrade to dmd 2.066.

That did the trick. Thanks.