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