www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - How to set workDir for std.process.execute ?

reply "KrzaQ" <dlangmailinglist krzaq.cc> writes:
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.
Aug 20 2014
parent reply ketmar via Digitalmars-d-learn <digitalmars-d-learn puremagic.com> writes:
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.
Aug 20 2014
parent "krzaq" <dlangmailinglist krzaq.cc> writes:
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.
Aug 20 2014