ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daffin, Miles \(IT\)" <>
Subject Delete the contents of a directory but not the directory itself
Date Fri, 12 Jan 2007 13:25:46 GMT
Dear All,
I want to delete everything in a base directory but *not* the base dir
itself. (The base dir *must not be deleted* because it is a mount point,
not a dir that can be created/deleted in a normal manner.) If I do this:
<delete verbose="true" >
  <fileset dir="${install.common.dir}" />

all files are deleted *but* it leaves empty dirs behind. I want the
empty dirs gone. However, if I tell delete to includeemptydirs then the
base dir is deleted too!
<delete verbose="true" includeemptydirs="true">
  <fileset dir="${install.common.dir}" />

Is this a bug? If not then how can I do this task?
Miles Daffin
Morgan Stanley | EAI | MSDE
20 Cabot Square | Canary Wharf | London E14 4QA | UK
Tel: +44 (0) 20 767 75119
Fax: +44 (0) 20 705 64572 <>

NOTICE: If received in error, please destroy and notify sender. Sender does not intend to
waive confidentiality or privilege. Use of this email is prohibited when received in error.

  • Unnamed multipart/alternative (inline, 7-Bit, 0 bytes)
View raw message