ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brent Bain <Bre...@mmlive.com>
Subject Delete Files and SubFolders
Date Mon, 27 Sep 2004 22:06:12 GMT
Hello:

I am trying to use the following code to delete everything under subfolders
(including deleting the subfolders themselves).  I can't seem to get it to
work.  I'm not sure if it's because I'm using a <path> or not.  I'm using
the antcontrib task to convert the path to a fileset (<pathtofileset>) -- my
code looks like this:
 
 <path id="codeBase.pathList">
  <fileset dir="${deploy.codeBase}">
   <include name="bin/**" />
   <include name="conf/**" />
  </fileset>
 </path>
 
 <target name="All">
  <property name="deploy.codeBase" value="c:/deploy/" />
 
  <pathtofileset name="delBase.pathList.fileset" dir="${deploy.codeBase}"
pathrefid="codeBase.pathList" />
 
  <delete includeEmptyDirs="true">
   <fileset refid="delBase.pathList.fileset" />
  </delete>
 </target>
 
This deletes the FILES but not the folders.
My directory structure looks like:
c:\
    deploy
        bin
            blocks
        conf
        properties
        wwwroot
            images
            etc...
 
What I'm trying to do is delete /bin/blocks/ and /conf/ completey.
If anyone can help I'd greatly appreciate it!
Thanks,
Brent

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message