Return-Path: Mailing-List: contact ant-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list ant-user@jakarta.apache.org Received: (qmail 10471 invoked from network); 12 Oct 2000 19:12:08 -0000 Received: from unknown (HELO homer.yaltacomm.com) (64.162.78.2) by locus.apache.org with SMTP; 12 Oct 2000 19:12:08 -0000 X-MimeOLE: Produced By Microsoft Exchange V6.0.4368.4 content-class: urn:content-classes:message Subject: RE: a possible bug in Exec ? MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Date: Thu, 12 Oct 2000 12:11:49 -0700 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: a possible bug in Exec ? Thread-Index: AcA0f6YpjWba6AidQ1O2mCupuZkqxAAAEdfw From: "Mahlen Morris" To: X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N Also, while I haven't tried it, past experience indicates that an exec on 'cmd /c dir' would be equivalent to doing dir in the command line. 'cmd' is the name of the NT command shell, and '/C' means "Carries out the command specified by string and then terminates" (from 'help cmd'). =20 mahlen =20 The horror of the Twentieth Century is the size of each event and the paucity of its reverberation. --Norman Mailer -----Original Message----- From: rwaldhof@us.britannica.com [mailto:rwaldhof@us.britannica.com] Sent: Thursday, October 12, 2000 12:06 PM To: ant-user@jakarta.apache.org Subject: RE: a possible bug in Exec ? "dir" is a command of the DOS shell (just like "ls" is usually defined within your Unix shell), not of the operating system itself. If you want to do a "dir", one way to do it is to create a batch file than runs it: _file: foo.bat_=20 dir=20 and run=20 =20 You could also create a generic batch shell, like:=20 _file: dynamic.bat_=20 %1 %2 %3 %4 %5 %6 %7 %8 %9=20 and use it for arbitrary DOS commands:=20 =20 This isn't a bug in Ant, or even java.lang.Runtime.exec(), but rather a "feature" of the relation between operating systems and shells. -----Original Message-----=20 From: Andy XueWen Qin [ mailto:aqin@cisco.com ]=20 Sent: Thursday, October 12, 2000 12:34 PM=20 To: ant-user@jakarta.apache.org=20 Subject: a possible bug in Exec ?=20 I'm trying to use exec task on Windows NT, it's very simple=20 test build.xml file, but giving out a strange error. When I=20 change the dir=3D"." to dir=3D"..", it works fine, any ideas ?=20 The ant version I'm using is Ant1.1.=20 -----------=20 build.xml=20 ------------=20 =20 =20 =20 =20 =20 =20 ------------=20 error message:=20 -----------=20 build.xml:4: Error exec: dir=20 java.io.IOException: CreateProcess: dir error=3D2=20 at java.lang.Win32Process.(Compiled Code)=20 at java.lang.Runtime.exec(Compiled Code)=20 at java.lang.Runtime.exec(Runtime.java:137)=20 at org.apache.tools.ant.taskdefs.Exec.run(Exec.java:124)=20 at org.apache.tools.ant.taskdefs.Exec.execute(Exec.java:77)=20 at org.apache.tools.ant.Target.execute(Compiled Code)=20 at org.apache.tools.ant.Project.runTarget(Project.java:717)=20 at org.apache.tools.ant.Project.executeTarget(Compiled Code)=20 at org.apache.tools.ant.Project.executeTargets(Compiled Code)=20 at org.apache.tools.ant.Main.runBuild(Compiled Code)=20 at org.apache.tools.ant.Main.main(Main.java:107)=20 Total time: 0 seconds=20 ------------------------=20 Thanks=20 /andy=20