ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shi chuan <shichu...@gmail.com>
Subject Re: ant execute Windows del command
Date Thu, 12 May 2011 19:17:04 GMT
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 <ddevienne@gmail.com>wrote:

> On Thu, May 12, 2011 at 1:45 PM, shi chuan <shichuanr@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-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message