ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David McTavish <dmctav...@SANDVINE.com>
Subject Using Exec within my own Task, divert stdout to null?
Date Fri, 07 Feb 2003 17:53:38 GMT
Is there a way that I can divert the standard output of an exec task used
within my own custom task to /dev/null? (Without setting this as a
command-line argument?)


            ExecTask exec = createExec();
            if (runtimeDir != null)
            {
                Environment.Variable var = new Environment.Variable();
                var.setKey("PATH");
                var.setPath(runtimeDir);
                exec.addEnv(var);
            }
            exec.setFailonerror(true);
            exec.setDir(baseDir);
            exec.setExecutable("myexec.exe");
            exec.createArg().setValue("/i");
            exec.createArg().setValue(initString);
            exec.execute();

Also, any ideas on how to "correct" the environment variable above (PATH),
such that it works on both cygwin and Windows. It seems that when run on
Windows, it wants to use C:\folder\folder connotation, instead of
/c/folder/folder. Any insight would be appreciated.

thx,
d.

Mime
View raw message