Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7657249
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T12:58:46+00:00 2026-05-31T12:58:46+00:00

I have two questions about the dirset type in Apache Ant. Is a dirset

  • 0

I have two questions about the dirset type in Apache Ant.

  • Is a dirset really a set, with no order guaranteed, or does it preserves the input order?
    I want to use ant:contrib to iterate over a set of directories and order matters, so if Ant’s dirset does not preserve insertion-order, what alternatives do I have?
  • How can I test if a certain dir is included within a dirset?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T12:58:47+00:00Added an answer on May 31, 2026 at 12:58 pm

    [Edit]

    If you look at the dirset source It looks like it uses java File.list(), whose documentation states that there is no gauranteed order. So no you can’t count on that absolutely. However, before returning it calls Arrays.sort(files); See Line 1572.


    As per preserving order I couldn’t say, I would hazard that there is no guarantee but that it usually just happens to preserve the file systems order.

    As to testing, I presume you want, do action if this file exists or something similar, using ant contrib,

    <for param="directory">
    <dirset dir="dirIneedtoexist">
    </dirset>
    <sequential>
         <!-- Stuff to do if it exists. -->          
    </sequential>
    </for>
    

    If there is nothing in the dirset if won’t do anything.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two related questions about Web services: (1) I'm currently writing a set
I have two questions about java.awt.Shape . Suppose I have two Shape s, shape1
So I have two questions about HashMap s in Java: What is the correct
I have two noobish questions about Flash, Actionscript, Flex etc. 1) With these technologies
I have a question about how to set up the relations between two models
I have two questions about using a BackgroundWorker: 1)Lets say you have Function A
I have two questions about Google's dense_hash_map , which can be used instead of
I have a two questions about authentication involving CouchDB. The questions are about a
I have two questions about axis labels: How do I make a label at
I have two questions about DA addressing mode. For example: STMDA R0!, {R1-R7} The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.