How to set workDir for std.process.execute ?

2014-08-20 Thread KrzaQ via Digitalmars-d-learn

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.


Re: How to set workDir for std.process.execute ?

2014-08-20 Thread ketmar via Digitalmars-d-learn
On Wed, 20 Aug 2014 16:07:47 +
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.


signature.asc
Description: PGP signature


Re: How to set workDir for std.process.execute ?

2014-08-20 Thread krzaq via Digitalmars-d-learn
On Wednesday, 20 August 2014 at 16:16:03 UTC, ketmar via 
Digitalmars-d-learn wrote:

On Wed, 20 Aug 2014 16:07:47 +
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.