Now I am trying to use the following, it seems the error message is gone,
but the file is not deleted:

<apply executable="cmd" dest="./${dir.publish}/${dir.images}/"
osfamily="windows" addsourcefile="false">
            <fileset dir="./${dir.source}/${dir.images}/" includes="*.png"/>
<arg value="-c del"/>
            <targetfile/>
            <mapper type="identity"/>
        </apply>

On Fri, May 13, 2011 at 2:55 AM, Dominique Devienne <ddevie...@gmail.com>wrote:

> On Thu, May 12, 2011 at 1:45 PM, shi chuan <shichu...@gmail.com> wrote:
> > Hi guys, I am trying to apply a task using Windows executable 'del' to
> > delete files, the reason I don't use <delete> is because it will delete
> even
> > if things are up to date.
> > However this runs into an error: cannot run program 'del'...error=2
> >
> > <apply executable="del" dest="./abc/" osfamily="windows"
> > addsourcefile="false">
>
> That's because 'del' is not a program, but a builtin 'cmd.exe' "Shell".
>
> That's similar to why http://ant.apache.org/manual/Tasks/exec.html
> uses 'cmd -c foo.bat'
>
> Thus try <apply executable="cmd" ...> and add "-c del" as a command
> line arg. --DD
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
> For additional commands, e-mail: user-h...@ant.apache.org
>
>

Reply via email to