You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by David <ac...@yahoo.es> on 2005/11/30 18:19:21 UTC

How to check availability of a set of files

Dear Members,
   
  Is it possible to check the availability of the set of generated files, with a given pattern?
   
  The following solution doesn't work:
   
   <target name="check-hbm.xml-present">
  <condition property="hbm.xml.present">
   <and>
    <available file="${middlegen.destDir}" type="dir"/>
    <available file="${middlegen.destDir}/com/amena/cac/domain/*.hbm.xml"/>
   </and>
  </condition>
 </target>
   
  it expect on the file attribute a file name or directory. I whould like to check the output directory exist and also the generated set of *.hbm.xml files on a given subfolder.
   
  Do you have any idea about how to solve this problem?
   
  Thanks in advance,
   
  David

		
---------------------------------
 Yahoo! Music Unlimited - Access over 1 million songs. Try it free.

Re: How to check availability of a set of files

Posted by Matt Benson <gu...@yahoo.com>.
--- David <ac...@yahoo.es> wrote:

> Dear Members,
>    
>   Is it possible to check the availability of the
> set of generated files, with a given pattern?
>    
>   The following solution doesn't work:
>    
>    <target name="check-hbm.xml-present">
>   <condition property="hbm.xml.present">
>    <and>
>     <available file="${middlegen.destDir}"
> type="dir"/>
>     <available
>
file="${middlegen.destDir}/com/amena/cac/domain/*.hbm.xml"/>
>    </and>
>   </condition>
>  </target>
>    
>   it expect on the file attribute a file name or
> directory. I whould like to check the output
> directory exist and also the generated set of
> *.hbm.xml files on a given subfolder.
>    
>   Do you have any idea about how to solve this
> problem?
>    
>   Thanks in advance,
>    
>   David

David: the availability of a fileset doesn't really
make sense, as a fileset can only contain files that
exist and are therefore "available" (by the task's
definition, anyway).  I haven't used middlegen, but if
it is guaranteed to create one Hibernate xml file
per... some other file, you could probably use the
uptodate task to verify that all expected target files
exist.  Also, once you have the relevant check in
place for your target files, you could probably omit
the check for their parent directory, don't you think?
;)

HTH,
Matt

> 
> 		
> ---------------------------------
>  Yahoo! Music Unlimited - Access over 1 million
> songs. Try it free.



	
		
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

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