Return-Path: Delivered-To: apmail-jakarta-ant-user-archive@apache.org Received: (qmail 78155 invoked from network); 12 Dec 2001 19:22:07 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 12 Dec 2001 19:22:07 -0000 Received: (qmail 27968 invoked by uid 97); 12 Dec 2001 19:21:58 -0000 Delivered-To: qmlist-jakarta-archive-ant-user@jakarta.apache.org Received: (qmail 27952 invoked by uid 97); 12 Dec 2001 19:21:57 -0000 Mailing-List: contact ant-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list ant-user@jakarta.apache.org Received: (qmail 27941 invoked from network); 12 Dec 2001 19:21:57 -0000 Message-ID: <20011212192157.33356.qmail@web13402.mail.yahoo.com> Date: Wed, 12 Dec 2001 11:21:57 -0800 (PST) From: Diane Holt Subject: RE: pushd and popd To: Ant Users List In-Reply-To: <7D380B2F4B3BD411B748009027855234019E1201@laxchange.weddingchannel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Don't you need to hook the whole thing together in quotes (like you would with 'sh -c "somecmd && someothercmd ...") -- ie: cmd /c "... && ... && ..." Diane --- Anthony Rodriguez wrote: > Interesting, I tried "pushd \\nqa2\testdir && cd && popd" from the > command line and it worked. > > However when I tried it with ant, it hangs. Here is my build.xml > snippet: > > > > > > > > > I get these results: > > C:\antdir>ant -v init pushpop -buildfile build.xml -Dnth.server=nqa2 > > Ant version 1.4Beta2 compiled on August 20 2001 > Buildfile: build.xml > Detected Java version: 1.3 in: c:\jdk1.3.1\jre > Detected OS: Windows 2000 > parsing buildfile C:\antdir\build.xml with URI = > file:C:/antdir/build.xml > Project base dir set to: C:\antdir > Property ${classpath} has not been set > Property ${home} has not been set > Build sequence for target `init' is [init] > > init: > [property] Loading C:\antdir\build.properties > > Build sequence for target `pushpop' is [pushpop] > > pushpop: > [exec] Current OS is Windows 2000 > [exec] cmd pushd \\nqa2\testdir\ && cd && popd > [exec] Microsoft Windows 2000 [Version 5.00.2195] > [exec] (C) Copyright 1985-2000 Microsoft Corp. > > Then it just hangs here. Is Ant waiting for the cmd exec to return > something that it's not returning? Does this happen whenever you run > something using cmd? > > -Anthony > > > -----Original Message----- > > From: Anthony Rodriguez [mailto:Anthony@WeddingChannel.com] > > Sent: Wednesday, December 12, 2001 10:16 AM > > To: 'Ant Users List' > > Subject: RE: pushd and popd > > > > > > What I'm really trying to acheive here is to map a network > > path to a drive > > letter, then copy files to that path. The copy utility I'm using was > > developed in-house and has trouble with UNC paths. It has > > other features > > however that are specific and necessary to my environment. > > So the idea was > > to pushd the UNC path, copy to the new drive that pushd > > assigns, then popd > > when I'm done. > > However by reading the various responses, it looks like Ant > > wouldn't leave > > me in the drive that pushd would assign. Is this correct? > > Is there a way > > for me to work around this aspect of Ant? Would I be better > > served by > > writing a .bat file and executing that from Ant? > > > > -Anthony > > > > > -----Original Message----- > > > From: Conor MacNeill [mailto:conor@cortexebusiness.com.au] > > > Sent: Tuesday, December 11, 2001 3:53 PM > > > To: Ant Users List > > > Subject: RE: pushd and popd > > > > > > > > > Anthony, > > > > > > What exactly are you trying to achieve? > > > > > > pushd and popd are builtins to the Windows shell. This is why > > > Ant cannot > > > execute them directly. The normal way around this would be to > > > actually exec > > > cmd.exe and ask it to run the built-in. > > > > > > In your case, however, the pushd and popd commands would only > > > affect the > > > process that is created for the operation. Any effect > > > they did have > > > would be lost when the completes and would not affect the Ant > > > process. > > > > > > Perhaps you can explain why you need to pushd/popd at all > > and we could > > > suggest an alternative approach. > > > > > > Conor > > > > > > > > > > > > > -----Original Message----- > > > > From: Anthony Rodriguez [mailto:Anthony@WeddingChannel.com] > > > > Sent: Wednesday, 12 December 2001 10:22 AM > > > > To: ant-user@jakarta.apache.org > > > > Subject: pushd and popd > > > > > > > > > > > > Has anyone had any luck using the Win 2000 programs, pushd > > > and popd? I'm > > > > trying to use it in my build.xml but it's not working. > > > > > > > > build.xml: > > > > ---------- > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Here are my results: > > > > -------------------- > > > > C:\antdir>ant -v init pushpop > > > > > > > > Ant version 1.4Beta2 compiled on August 20 2001 > > > > Buildfile: build.xml > > > > Detected Java version: 1.3 in: c:\jdk1.3.1\jre > > > > Detected OS: Windows 2000 > > > > parsing buildfile C:\antdir\build.xml with URI = > > > file:C:/antdir/build.xml > > > > Project base dir set to: C:\antdir > > > > Property ${classpath} has not been set > > > > Property ${home} has not been set > > > > Build sequence for target `init' is [init] > > > > > > > > init: > > > > [property] Loading C:\antdir\build.properties > > > > Build sequence for target `pushpop' is [pushpop] > > > > > > > > pushpop: > > > > [exec] Current OS is Windows 2000 > > > > [exec] pushd \\nqa2\testdir\ > > > > > > > > BUILD FAILED > > > > > > > > C:\antdir\build.xml:256: Execute failed: > > > java.io.IOException: CreatePro > > > > cess: pushd \\nqa2\testdir\ error=2 > > > > at > > > > org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java:281) > > > > at > > > > org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:177) > > > > at org.apache.tools.ant.Task.perform(Task.java:217) > > > > at org.apache.tools.ant.Target.execute(Target.java:164) > > > > at > > org.apache.tools.ant.Target.performTasks(Target.java:182) > > > > at > > > org.apache.tools.ant.Project.executeTarget(Project.java:601) > > > > at > > > org.apache.tools.ant.Project.executeTargets(Project.java:560) > > > > at org.apache.tools.ant.Main.runBuild(Main.java:454) > > > > at org.apache.tools.ant.Main.start(Main.java:153) > > > > at org.apache.tools.ant.Main.main(Main.java:176) > > > > --- Nested Exception --- > > > > java.io.IOException: CreateProcess: pushd \\nqa2\testdir\ error=2 > > > > at java.lang.Win32Process.create(Native Method) > > > > at java.lang.Win32Process.(Win32Process.java:66) > > > > at java.lang.Runtime.execInternal(Native Method) > > > > at java.lang.Runtime.exec(Runtime.java:551) > > > > at java.lang.reflect.Method.invoke(Native Method) > > > > at > > > > > > > > > org.apache.tools.ant.taskdefs.Execute$Java13CommandLauncher.exec(Exec > > > > ute.java:564) > > > > at > > > org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:384) > > > > at > > > > > > org.apache.tools.ant.taskdefs.ExecTask.runExecute(ExecTask.java:250) > > > > at > > > > org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java:279) > > > > at > > > > org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:177) > > > > at org.apache.tools.ant.Task.perform(Task.java:217) > > > > at org.apache.tools.ant.Target.execute(Target.java:164) > > > > at > > org.apache.tools.ant.Target.performTasks(Target.java:182) > > > > at > > > org.apache.tools.ant.Project.executeTarget(Project.java:601) > > > > at > > > org.apache.tools.ant.Project.executeTargets(Project.java:560) > > > > at org.apache.tools.ant.Main.runBuild(Main.java:454) > > > > at org.apache.tools.ant.Main.start(Main.java:153) > > > > at org.apache.tools.ant.Main.main(Main.java:176) > > > > > > > > Total time: 2 seconds > > > > > > > > Any idea what is going wrong here? > > > > > > > > -Anthony > > > > > > > > > > > > > -- > > > To unsubscribe, e-mail: > > > > > > For additional commands, e-mail: > > > > > > > > > ===== (holtdl@yahoo.com) __________________________________________________ Do You Yahoo!? Check out Yahoo! Shopping and Yahoo! Auctions for all of your unique holiday gifts! Buy at http://shopping.yahoo.com or bid at http://auctions.yahoo.com -- To unsubscribe, e-mail: For additional commands, e-mail: