<delete dir="${classes.dir}" />
It will delete the classes.dir too --- I want to be able to delete
everything underneath except the parent directory (i.e. classes.dir)

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

*: (613)592-2100 ext:3281
*: [EMAIL PROTECTED]



-----Original Message-----
From: Nicholas Christopher [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 22, 2001 1:39 PM
To: '[EMAIL PROTECTED]'
Subject: RE: delete and mkdir problem


I use:

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

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


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
*: [EMAIL PROTECTED]



-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Glenn McAllister
Sent: Monday, January 22, 2001 1:02 PM
To: [EMAIL PROTECTED]
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

Reply via email to