ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Francis GALIEGUE <...@one2team.com>
Subject Re: Making the delete task behave like /bin/rm -rf vis-a-vis symlinks to directories
Date Thu, 02 Jul 2009 08:29:14 GMT
On Tue, Jun 30, 2009 at 23:19, Andy
Stevens<insomniacpenguin@googlemail.com> wrote:
> On 26/06/2009, jscripter <pc88mxer@gmail.com> wrote:
>>
>>  The main problem with this is that I don't want to keep track of which
>>  symlinks to delete.
>>  The tree I am deleting may have lots of symlinks.
>>
>>  I realize that Java doesn't know about symlinks and that Ant uses a
>>  heuristic to determine if a file object is a symlink, but is there a way to
>>  create a fileset of everything that looks like a symlink?
>
> Just a thought - is there a way to build a fileset from the output of
> an <exec> task?  If so, how about using that to call "find . -type l
> -print" in the relevant directory?
>
>

<exec output="/path/to/symlink/list" executable="/usr/bin/find">
    <arg value="/the/dir"/>
    <arg value="-type"/>
    <arg value="l"/>
</exec>

<fileset id="victims" dir="/the/dir">
    <includesfile name="/path/to/symlink/list>
</fileset>


-- 

Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
fge@one2team.com
40 avenue Raymond Poincaré
75116 Paris

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message