Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

DELETE Ant task? Anything faster? (Edit Nevermind)

  • 03-08-2004 10: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