ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sibon Barman" <si...@ss8.com>
Subject RE: delete and mkdir problem
Date Mon, 22 Jan 2001 18:35:15 GMT
How come the following snippet doesn't remove the empty directories under
classes.dir:
<delete>
  <fileset dir="${classes.dir}" />
</delete>

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?

Thanks,

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

*: (613)592-2100 ext:3281
*: sibon@ss8.com



-----Original Message-----
From: glenn@dryline-fw.wireless-sys.com
[mailto:glenn@dryline-fw.wireless-sys.com]On Behalf Of Glenn McAllister
Sent: Monday, January 22, 2001 1:02 PM
To: ant-user@jakarta.apache.org
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
this
> 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
used
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:

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

Glenn McAllister


Mime
View raw message