ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Coral Featherstone <Cor...@discovery.co.za>
Subject creating dirs when they dont exist
Date Thu, 29 May 2003 10:39:07 GMT
Hi All,
I've combed the archives but I just can't seem to find a solution.

I need to create directories if they don't exist.
Mkdir fails if the directory does exists. Not calling mkdir makes several
other tasl fail (jar, ear etc)

I've tried
   <target name="checkdir.bck">
  	<available file="${BACKUP_DEST}" property="checkdir.bck.isElusive"/>
  </target>
  
  <target name="mkdir.bck" depends="checkdir.bck"
unless="checkdir.bck.isElusive">
   	<mkdir dir="${BACKUP_DEST}"/>
  </target>

But obviously checkdir.bck.isElusive never gets set
------------------
Ive tried
 <target name="checkdir.webdoc">
   	 <dirset dir="${BASE_DIRECTORY}${WEBDOC_DESTINATION}"
id="emptyfileset"/>
      	<pathconvert pathsep="${path.separator}" dirsep="${file.separator}"
property="checkdir.webdoc.isElusive" refid="emptyfileset"/>
      <condition >
          <equals arg1="${emptyfileset}" arg2=""/>
      </condition>
  </target>
  
  <target name="mkdir.webdoc" depends="checkdir.webdoc"
if="checkdir.webdoc.isElusive">
   	<mkdir dir="${BASE_DIRECTORY}${WEBDOC_DESTINATION}"/>
  </target>

This works for files not directories and pathconvert fails when the
directory is missing.


<touch> doesn't work because sometimes there is more that one directory in
the hierarchy that is missing

Am I missing something obvious???

Mime
View raw message