I have two questions about the dirset type in Apache Ant.
[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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With