You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Tibor Strausz <Ti...@tridion.com> on 2002/08/15 16:32:51 UTC

move dir if available

i want to move old dirs but when they do not exist the move task fails
but i want to continu 
i can think of a <Available> task to first check if the dir is available and
put the move task in a seperate target with a if/unless task
but than its seems to me like a lot of code for such a simple thing to do
is there a beter way??

tibi


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: move dir if available

Posted by Geoff Meakin <ge...@isocra.com>.
Well as a bit of a hack you can move a null directory.
That is

<move todir="">
  <fileset dir=""/>
</move>

Which will do nothing (but it does attempt to self-referential move.

How does this help, you might ask?
Well you can then use your <available> to define a property to be null
if the dir doesnt exist, or the dir name if it does, and then
apply this move task to it. This saves you doing another target.

Cheers
-Geoff


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: move dir if available

Posted by Matt Benson <gu...@yahoo.com>.
I think it ought to work for you to move like this:

<move todir="new">
  <fileset dir="${basedir}" includes="old,old/**"
</move>

However for some reason "old" is not removed.

Does anyone else consider this a bug?

-Matt

--- Tibor  Strausz <Ti...@tridion.com> wrote:
> 
> i want to move old dirs but when they do not exist
> the move task fails
> but i want to continu 
> i can think of a <Available> task to first check if
> the dir is available and
> put the move task in a seperate target with a
> if/unless task
> but than its seems to me like a lot of code for such
> a simple thing to do
> is there a beter way??
> 
> tibi
> 
> 
> --
> To unsubscribe, e-mail:  
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 


__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>