You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Andy XueWen Qin <aq...@cisco.com> on 2000/10/12 19:33:47 UTC

a possible bug in Exec ?

I'm trying to use exec task on Windows NT, it's very simple
test build.xml file, but giving out a strange error. When I
change the dir="." to dir="..", it works fine, any ideas ?
The ant version I'm using is Ant1.1.
-----------
build.xml
------------
<?xml version="1.0" ?>
<project name="test" default="dist" basedir=".">
  <target name="dist" >
    <exec dir="." command="dir" os="Windows NT" output="dir.txt" />
  </target>
</project>
------------
error message:
-----------
build.xml:4: Error exec: dir
java.io.IOException: CreateProcess: dir error=2
        at java.lang.Win32Process.<init>(Compiled Code)
        at java.lang.Runtime.exec(Compiled Code)
        at java.lang.Runtime.exec(Runtime.java:137)
        at org.apache.tools.ant.taskdefs.Exec.run(Exec.java:124)
        at org.apache.tools.ant.taskdefs.Exec.execute(Exec.java:77)
        at org.apache.tools.ant.Target.execute(Compiled Code)
        at org.apache.tools.ant.Project.runTarget(Project.java:717)
        at org.apache.tools.ant.Project.executeTarget(Compiled Code)
        at org.apache.tools.ant.Project.executeTargets(Compiled Code)
        at org.apache.tools.ant.Main.runBuild(Compiled Code)
        at org.apache.tools.ant.Main.main(Main.java:107)

Total time: 0 seconds
------------------------

Thanks
/andy