Just wanted to step out from lurking and add an example

<available file="${your.file.path.here}" 
property="your.file.path.here.present"/>
<echo message="your.file.path.here.present: ${your.file.path.here.present}"/>

<!-- possible results: -->
<!-- your.file.path.here.present = path does not exist (note the property will 
be undefined!) -->
<!-- true = path exists -->

<if>
  <equals arg1="${your.file.path.here.present}" arg2="true"/>
  <then>
  </then>
  <else>
  </else>
</if>

hth

Stephan Frank Henry
Programming
HandyGames
 
www.handy-games.com GmbH
i_Park Klingholz 13
97232 Giebelstadt
Germany
 
_________________________________________
 
Tel.: +49 (0) 9334 9757 - 33
Fax: +49 (0) 9334 9757 - 19
Mail: [EMAIL PROTECTED]
 

> -----Ursprüngliche Nachricht-----
> Von: Ninju Bohra [mailto:[EMAIL PROTECTED] 
> Gesendet: Montag, 3. Oktober 2005 04:16
> An: Ant Users List
> Betreff: Re: Check directory exists
> 
> Or you can use the <available> task (with the "type"
> attribute equal to "dir") if just need to know whether the 
> directory is already there :-)
> 
> --- Jeffrey E Care <[EMAIL PROTECTED]> wrote:
> 
> > just run <mkdir>; it won't post an error if the directory already 
> > exists
> > 
> > --
> > Jeffrey E. Care ([EMAIL PROTECTED])
> > WebSphere v7 Release Engineer
> > WebSphere Build Tooling Lead (Project Mantis)
> > 
> > 
> > 
> > 
> > João Augusto Charnet <[EMAIL PROTECTED]>
> > 09/30/2005 06:36 PM
> > Please respond to
> > "Ant Users List"
> > 
> > 
> > To
> > Ant Users List <[email protected]>
> > cc
> > 
> > Subject
> > Check directory exists
> > 
> > 
> > 
> > 
> > 
> > 
> > Hello.
> > Is is possible to check if a given directory exists through ant?
> > I have a task that compiles some java files, and I'd like 
> to check if 
> > the directory passed to the javac exists before running javac.
> > Any ideas ?
> > 
> > Thanks a lot.
> > John
> > --
> > Softway & Softcomex
> > João Augusto Charnet
> > Computer Engineer - R&D Team
> > 
> > Phone/Fax: 55 19 3739-9261
> > E-mail: [EMAIL PROTECTED]
> > R. Conceicao, 233 - Cj, 609 - Centro
> > 13010-050 - Campinas - SP - Brazil
> > 
> > 
> 
> 
> 
> 
> 
> 
>               
> __________________________________
> Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED] For 
> additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

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

Reply via email to