Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

DELETE Ant task? Anything faster? (Edit Nevermind)

  • 03-08-2004 11:33AM
    #1
    Registered Users, Registered Users 2 Posts: 21,264 ✭✭✭✭


    you used to be able to delete a whole directory fast in ANT, now it appears a lot is deprecated and I have to use fileset to list what I want to delete.

    So how do I delete faster in ANT without using deprecations, or spawning to the OS?
    <delete includeemptydirs="true" failonerror="yes">
        <fileset dir="${dir.to.delete}" casesensitive="no">
            <include name="**/**"/>
        </fileset>
    </delete>
    

    This works, but is horribly slow (as there are around 200,000 files in the subdirectories).

    Edit: I was using the wrong combinations of arguments which was triggering the deprecation message. This below works fine.
    <delete dir="${dir.to.delete}" failonerror="yes"/>
    


Comments

  • Registered Users, Registered Users 2 Posts: 15,443 ✭✭✭✭bonkey


    'cording to the manual, Hobbes, the delete command takes either a file attribute, a dir attribute, or a fileset.

    It says you must have one or the other, unless a fileset is used.

    So I'd say a spot of R'ing TFM might should you on this one.

    jc

    Edit: Apparently you've just discovered this yourself.


  • Registered Users, Registered Users 2 Posts: 21,264 ✭✭✭✭Hobbes


    bonkey wrote:
    So I'd say a spot of R'ing TFM might should you on this one.

    Actually I've read the manual.

    If you use an attribute which is used by the fileset eg. includeemptydirs="true", then it thinks your trying to delete files not a directory and that is what triggered the Deprecation warnings.


Advertisement