ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rebhan, Gilbert" <Gilbert.Reb...@huk-coburg.de>
Subject RE: How to Check if Directory exists?
Date Tue, 09 Sep 2008 12:47:57 GMT

-----Original Message-----
From: Brill, C [mailto:C.Brill@t-systems.com]
Sent: Tuesday, September 09, 2008 2:32 PM
To: user@ant.apache.org
Subject: How to Check if Directory exists?

/*
Hi,

I've got a little problem.
Here is the existing directory structure:

drwxrwxr-x   5 symosyad   edasql          96 Sep  9 13:14 DWH-PQ-HQ-0837
-rw-r-----   1 symosyad   edasql        3760 Sep  9 13:14
DWH-PQ-HQ-0837_Lieferung.tar.gz
drwxr-xr-x   3 symosyad   edasql          96 Sep  9 13:12 archiv

In one of the first steps in my build.xml I want to check if the file
'DWH-PQ-HQ-0837_Lieferung.tar.gz' and the directory 'DWH-PQ-HQ-0837'
exist.
If the exist I want to move them into 'archiv'.
With the <available> task I can only check if files exists, isn't it?
*/

<condition property="tobemoved">
 <and>
  <available file="/path/to/DWH-PQ-HQ-0837_Lieferung.tar.gz"/>
  <available file="/path/to/DWH-PQ-HQ-0837/>"
 </and>
</condition>
...

<target name="archive" if="tobemoved">
...
</target>

Regards, Gilbert

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message