RE: pushd and popd

2001-12-13 Thread Joe Cheng

Don't know if this will help you, but are you aware that you can use "&" to
string together commands onto one line... this is at least true on Windows
2000, not sure about NT.

>From the command reference:

The ampersand (&) separates multiple commands on one command line. 
The parentheses groups multiple commands. 
The semicolon or comma (; ,) separate command parameters. 
The caret (^) cancels a subsequent command symbol's special meaning so you
can use a command symbol as text. 
The double ampersand (&&) causes the command following this symbol to run
only if the command preceding the symbol is successful. 
The double pipe (||) causes the command following this symbol to run only if
the command preceding the symbol fails. 

In other words, "pushd \\server\testdir\ & cd & popd" should work...

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: pushd and popd

2001-12-12 Thread Anthony Rodriguez

I perused the archives and found:
1) 

2) 


Sorry, I should've looked there first.  Thanks for all the help.

-Anthony

> -Original Message-
> From: Anthony Rodriguez [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, December 12, 2001 2:24 PM
> To: 'Ant Users List'
> Subject: RE: pushd and popd
> 
> 
> OK.  I have resolved that Ant will not do this properly.  
> However, this can
> be done in a batch file.  So now the question I have is, how 
> do I get a
> newline with the  task?
> 
>   
> 
> 
> 
>   
> 
> However the batch file (test.bat) looks like:
> pushd \\server\testdir\cdpopd
> 
> 
> I want the file to have the commands on separate lines.  \n 
> and  don't
> work with echo.
> 
> -Anthony
> 
> 
> 
> > -Original Message-
> > From: Jesse Stockall [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, December 12, 2001 11:45 AM
> > To: Ant Users List
> > Subject: RE: pushd and popd
> > 
> > 
> > On Wed, 2001-12-12 at 13:16, Anthony Rodriguez wrote:
> > > 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.
> > 
> > Wouldn't "net use z: \\server\share" get you what you need? 
> You could
> > use the exec task to map the drive & then use copy
> > 
> > 
> > -- 
> >  Jesse Stockall |   Tel: 1+ 
> > 613.599.2441 ext. 243
> >  CRYPTOCard Corporation |   Fax: 1+ 
> > 613.599.2442
> >  Suite 304, 300 March Rd.   |   email: [EMAIL PROTECTED]
> >  Ottawa, ON, Canada K2K 2E2 |   web: www.cryptocard.com 
> > 
> -
> > 
> > 
> > --
> > To unsubscribe, e-mail:   
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: 
<mailto:[EMAIL PROTECTED]>



RE: pushd and popd

2001-12-12 Thread Anthony Rodriguez

OK.  I have resolved that Ant will not do this properly.  However, this can
be done in a batch file.  So now the question I have is, how do I get a
newline with the  task?

  



  

However the batch file (test.bat) looks like:
pushd \\server\testdir\cdpopd


I want the file to have the commands on separate lines.  \n and  don't
work with echo.

-Anthony



> -Original Message-
> From: Jesse Stockall [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, December 12, 2001 11:45 AM
> To: Ant Users List
> Subject: RE: pushd and popd
> 
> 
> On Wed, 2001-12-12 at 13:16, Anthony Rodriguez wrote:
> > 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.
> 
> Wouldn't "net use z: \\server\share" get you what you need? You could
> use the exec task to map the drive & then use copy
> 
> 
> -- 
>  Jesse Stockall   |   Tel: 1+ 
> 613.599.2441 ext. 243
>  CRYPTOCard Corporation   |   Fax: 1+ 
> 613.599.2442  
>  Suite 304, 300 March Rd. |   email: [EMAIL PROTECTED]
>  Ottawa, ON, Canada K2K 2E2   |   web: www.cryptocard.com 
> -
> 
> 
> --
> To unsubscribe, e-mail:   
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>



RE: pushd and popd

2001-12-12 Thread Jesse Stockall

On Wed, 2001-12-12 at 13:16, Anthony Rodriguez wrote:
> 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.

Wouldn't "net use z: \\server\share" get you what you need? You could
use the exec task to map the drive & then use copy


-- 
 Jesse Stockall |   Tel: 1+ 613.599.2441 ext. 243
 CRYPTOCard Corporation |   Fax: 1+ 613.599.2442
 Suite 304, 300 March Rd.   |   email: [EMAIL PROTECTED]
 Ottawa, ON, Canada K2K 2E2 |   web: www.cryptocard.com 
-


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: pushd and popd

2001-12-12 Thread Diane Holt

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 <[EMAIL PROTECTED]> 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:[EMAIL PROTECTED]]
> > 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:[EMAIL PROTECTED]]
> > > 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:[EMAIL PROTECTED]]
> > > > Sent: Wednesday, 12 December 2001 10:22 AM
> > > > To: [EMAIL PROTECTED]
> > > > 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
> > > >
>

Re: pushd and popd

2001-12-12 Thread Diane Holt

--- [EMAIL PROTECTED] wrote:
> If you need pushd/popd only to change into another dir and do a quick 
> command or two from there, the "cmd /c pusd ... && "
> syntax  may do the trick.

If you're just wanting to execute a command in a directory other than the
current one, you can specify that directory with 's "dir" attribute.

Diane

=
([EMAIL PROTECTED])



__
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: 




RE: pushd and popd

2001-12-12 Thread Anthony Rodriguez

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:[EMAIL PROTECTED]]
> 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:[EMAIL PROTECTED]]
> > 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:[EMAIL PROTECTED]]
> > > Sent: Wednesday, 12 December 2001 10:22 AM
> > > To: [EMAIL PROTECTED]
> > > 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: 

Re: pushd and popd

2001-12-12 Thread Steve Loughran


- Original Message -
From: "Anthony Rodriguez" <[EMAIL PROTECTED]>
To: "'Ant Users List'" <[EMAIL PROTECTED]>
Sent: Wednesday, December 12, 2001 10:16 AM
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
>

You dont need to faff around with pushd and popd; I am not even sure that
net use is needed if you set your domain up right



 
   
 


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




RE: pushd and popd

2001-12-12 Thread Anthony Rodriguez

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:[EMAIL PROTECTED]]
> 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:[EMAIL PROTECTED]]
> > Sent: Wednesday, 12 December 2001 10:22 AM
> > To: [EMAIL PROTECTED]
> > 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)
>

Re: pushd and popd

2001-12-12 Thread Nico Seessle

- Original Message -
From: "Frank E. Weiss" <[EMAIL PROTECTED]>
To: "Ant Users List" <[EMAIL PROTECTED]>
Sent: Wednesday, December 12, 2001 4:23 AM
Subject: Re: pushd and popd


> [EMAIL PROTECTED] wrote:
>
> > Unfortunately, Java does not support the notion of a changeable current
> > process directory.
> >
>
> BINGO! That's why ant's implementation of  is so twisted. People at
Sun
> are looking into fixing the JVM for java.lang.Runtime.exec() by adding a
way
> to set the subprocesses working directory. The reason they don't allow
> changing the cwd in a JVM is because of thread safety issues.

And I thought they already did that for JDK 1.3?

http://java.sun.com/j2se/1.3/docs/api/java/lang/Runtime.html#exec(java.lang.
String[],%20java.lang.String[],%20java.io.File)

Nico



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




RE: pushd and popd

2001-12-11 Thread Conor MacNeill

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:[EMAIL PROTECTED]]
> Sent: Wednesday, 12 December 2001 10:22 AM
> To: [EMAIL PROTECTED]
> 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:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




Re: pushd and popd

2001-12-11 Thread Frank E. Weiss

[EMAIL PROTECTED] wrote:

> Unfortunately, Java does not support the notion of a changeable current
> process directory.
>

BINGO! That's why ant's implementation of  is so twisted. People at Sun
are looking into fixing the JVM for java.lang.Runtime.exec() by adding a way
to set the subprocesses working directory. The reason they don't allow
changing the cwd in a JVM is because of thread safety issues.


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: pushd and popd

2001-12-11 Thread Frank E. Weiss

I had no trouble with this using ant 1.4. Perhaps it is a JVM problem.

Anthony Rodriguez wrote:

> 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:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




Re: pushd and popd

2001-12-11 Thread Frank E. Weiss

I think this analysis is incorrect. Ant 1.4.1 asks the JVM to execute 'cmd /c
cd x && y', where x is the current working directory (user.dir) and y is the
command line (pushd \\nqa2\testdir\). Wouldn't the example give here result in
'cmd /c cd x && cmd /c pushd \\nqa2\testdir\'?

Part of the confusion is that the way ant works. The executable attribute of
the exec element is a misnomer. On Windows 2000 it just becomes part of the
string that the cmd shell is being asked to execute. At least that's my
interpretation of the Windows 2000 CMD ducumentation.

[EMAIL PROTECTED] wrote:

> Diane is correct. It would look something like:
>
> 
>
>
>
>
>
>
> 
>
> -Original Message-
> From: Diane Holt [mailto:[EMAIL PROTECTED]]
> Sent: 11 December, 2001 03:59 PM
> To: Ant Users List
> Subject: Re: pushd and popd
>
> --- Anthony Rodriguez <[EMAIL PROTECTED]> wrote:
> > Has anyone had any luck using the Win 2000 programs, pushd and popd?
>
> Most likely they're built-ins rather than executables, so you'd need to
> exec DOS's command shell, with pushd/popd as args to it.
>
> Diane
>
> =
> ([EMAIL PROTECTED])
>
> __
> 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:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




Re: pushd and popd

2001-12-11 Thread vlad

Even after you succeed running these [by using something like "cmd /c 
pushd ..." etc] it will be of no use: the commands take effect in the 
spawned processes and do not affect the current JVM process that is 
running ANT.

Unfortunately, Java does not support the notion of a changeable current 
process directory.

If you need pushd/popd only to change into another dir and do a quick 
command or two from there, the "cmd /c pusd ... && " syntax 
may do the trick.

Vlad.


Please respond to "Ant Users List" <[EMAIL PROTECTED]>
To: Ant Users List <[EMAIL PROTECTED]>
cc: 

Subject:Re: pushd and popd


--- Anthony Rodriguez <[EMAIL PROTECTED]> wrote:
> Has anyone had any luck using the Win 2000 programs, pushd and popd?

Most likely they're built-ins rather than executables, so you'd need to
exec DOS's command shell, with pushd/popd as args to it.

Diane

=
([EMAIL PROTECTED])



__
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:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>






Re: pushd and popd

2001-12-11 Thread Steve Loughran


- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, December 11, 2001 5:53 PM
Subject: RE: pushd and popd


> Diane is correct. It would look something like:
>
> 
>
>
>
>
>
>
> 
>

I am not convinced this will have much effect. the first pushd is in one
instance of the shell, the popd is in a second instance .

It is like having two windows open, typing pushd in one and then going popd
in the other;

-steve


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




RE: pushd and popd

2001-12-11 Thread Nathan . Tran

Diane is correct. It would look something like:


   
   
   
   
   
   




-Original Message-
From: Diane Holt [mailto:[EMAIL PROTECTED]]
Sent: 11 December, 2001 03:59 PM
To: Ant Users List
Subject: Re: pushd and popd


--- Anthony Rodriguez <[EMAIL PROTECTED]> wrote:
> Has anyone had any luck using the Win 2000 programs, pushd and popd? 

Most likely they're built-ins rather than executables, so you'd need to
exec DOS's command shell, with pushd/popd as args to it.

Diane

=
([EMAIL PROTECTED])



__
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:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




RE: pushd and popd

2001-12-11 Thread Anthony Rodriguez

ok, that seemed to work.  But now it just hangs at pushd.  I can't seem to
run any tasks after that.

-Anthony

> -Original Message-
> From: Diane Holt [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, December 11, 2001 3:59 PM
> To: Ant Users List
> Subject: Re: pushd and popd
> 
> 
> --- Anthony Rodriguez <[EMAIL PROTECTED]> wrote:
> > Has anyone had any luck using the Win 2000 programs, pushd 
> and popd? 
> 
> Most likely they're built-ins rather than executables, so 
> you'd need to
> exec DOS's command shell, with pushd/popd as args to it.
> 
> Diane
> 
> =
> ([EMAIL PROTECTED])
> 
> 
> 
> __
> 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:   
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>



Re: pushd and popd

2001-12-11 Thread Diane Holt

--- Anthony Rodriguez <[EMAIL PROTECTED]> wrote:
> Has anyone had any luck using the Win 2000 programs, pushd and popd? 

Most likely they're built-ins rather than executables, so you'd need to
exec DOS's command shell, with pushd/popd as args to it.

Diane

=
([EMAIL PROTECTED])



__
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:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




pushd and popd

2001-12-11 Thread Anthony Rodriguez

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