ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicholas Christopher <>
Subject RE: delete and mkdir problem
Date Mon, 22 Jan 2001 18:39:08 GMT
I use:

<delete dir="${classes.dir}" />

-----Original Message-----
From: Sibon Barman []
Sent: Monday, January 22, 2001 1:35 PM
Subject: RE: delete and mkdir problem

How come the following snippet doesn't remove the empty directories under
  <fileset dir="${classes.dir}" />

It removes all the files underneath but not the empty directories? Is there
any way to remove everything under classes.dir without removing classes.dir?


Sibon Barman
SS8 Networks, Inc.
Suite 500
495 March Road, Kanata,
Ontario K2K 3G1

*: (613)592-2100 ext:3281

-----Original Message-----
[]On Behalf Of Glenn McAllister
Sent: Monday, January 22, 2001 1:02 PM
Subject: Re: delete and mkdir problem

Sibon Barman wrote:

> Hi all,
> I have the following target in my build script:
> <target name="real-clean">
>         <delete dir="${classes.dir}" />
>         <delete dir="${lib.dir}" />
>         <delete dir="${javadocs.dir}" />
>         <mkdir dir="${classes.dir}" />
>         <mkdir dir="${lib.dir}" />
>         <mkdir dir="${javadocs.dir}" />
> </target>
> But once in a while it is not successful in creating all 3 directories.
> Sometimes it works --- sometimes it doesn't. Can somebody help me with
> unpredictable problem? This error also occurs when I am in the lib.dir or
> classes.dir from Windows Explorer and the ant script  tries to delete them
> and create them  ---- could that be the problem?

If there is any process that has an "open" handle on the directory you are
trying to delete or create, the <delete> and <mkdir> tasks will fail.  I
to have this problem a lot when I was testing builds on my WinNT box.  The
upshot is, never have Explorer open on any directory you are working with in
your build.  Its safer that way.

> My second question is how can I delete everything underneath classes.dir
> with removing the classes.dir?

I'm assuming you mean "without" removing classes.dir:

  <fileset dir="${classes.dir}" />

Glenn McAllister

View raw message