0

When this Ant target runs, it takes over 30 minutes to complete on a directory with only ~2k files.

<target name="makewritable">
    <attrib readonly="false">
        <fileset dir="${somedir}">
    </attrib>
</target>

I thought something was horribly wrong until I turned on verbose for the entire file and saw

   [attrib] Executing 'attrib' with arguments:"
   [attrib] '-R'
   [attrib] 'C:\some\path\to\somedir\files.ext'
   [attrib] 
   [attrib] The ' characters around the executable and arguments are
   [attrib] not part of the command.

popping up only about once per second and doing this for each file in somedir. I even tried this with includes and excludes with no noticeable difference.

My question is... Are any of you having different results than this? If so, do you know what might cause this to speed up or slow down? I can't imagine this speed of execution is intended by Apache.

Additional Info: Using Ant version 1.8.0 on a Windows 7 OS

Community
  • 1
  • 1
  • Likely a bug fixed in newer versions of Ant: https://bz.apache.org/bugzilla/show_bug.cgi?id=54128 – martin clayton Oct 20 '17 at 16:46
  • What you said may be true, but the apache link you provided only describes exec tasks continuing forward on 100ms sleep cycles. What I'm seeing is more in the range of 900-1500ms and is specifically , all other task types are performing quickly, not exhibiting delays. – Nick Condatore Oct 20 '17 at 17:13
  • fwiw. This one also, a dupe of the above: https://bz.apache.org/bugzilla/show_bug.cgi?id=48734 applies to your version. You may have another problem, but seems the bug is part of it. – martin clayton Oct 20 '17 at 18:23
  • Ah, yep, that describes it exactly. Reading through, it looks like this may or may not have been fixed in later versions of Ant. Lots of back and forth in those bugzilla comments. Thanks for the sleuthing! – Nick Condatore Oct 20 '17 at 18:51
  • You're welcome Nick. I think I hit this myself a while back and IIRC we ended up rolling our own attrib wrap via exec, processing multiple files in each invocation. – martin clayton Oct 20 '17 at 19:03
  • @martinclayton I'd like to mark this as answered and give you the credit you deserve. Would you mind making an answer post with that second bugzilla link? – Nick Condatore Nov 28 '17 at 21:10
  • Hi Nick - wil do so as soon as I can. – martin clayton Nov 29 '17 at 16:40

0 Answers0