Return-Path: Delivered-To: apmail-jakarta-ant-user-archive@apache.org Received: (qmail 5351 invoked from network); 10 Oct 2002 23:21:19 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 10 Oct 2002 23:21:19 -0000 Received: (qmail 7301 invoked by uid 97); 10 Oct 2002 23:21:56 -0000 Delivered-To: qmlist-jakarta-archive-ant-user@jakarta.apache.org Received: (qmail 7266 invoked by uid 97); 10 Oct 2002 23:21:55 -0000 Mailing-List: contact ant-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list ant-user@jakarta.apache.org Received: (qmail 7254 invoked by uid 98); 10 Oct 2002 23:21:54 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Message-ID: <3DA60B52.90508@hotu.com> Date: Thu, 10 Oct 2002 13:20:50 -1000 From: newsham@hotu.com User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020826 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Ant Users List Subject: Re: create cab in linux; patch request References: <3DA49A3C.6040503@dallaway.com> <3DA4A1CD.2000406@hotu.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Stefan Bodewig wrote: >this is what google has given me as the second hit: > > > > Thanks Stefan. Although the link contained an rpm, I was able to extract the necessary files to get it to work. However, I ran into trouble with ant. The cab task in ant would hang when the file list was very large. With a very simple code change, I was able to get it to work again, so how can I get this fix into the ant distribution? Is it sufficient to post here, or should I post to the devel list? Here is the problem and the fix. Listcab (the executable that comes with libcabinet) runs in interactive mode, prompting the user for the files to archive, one at a time. In order to accommodate this, the cab task builds a StringBuffer which lists all of the files to archive, one per line. The task then exec's listcab, sends the entire buffer to its stdin, then pumps the stdout and stderr so that it doesn't hang. Unfortunately stdin's buffer can become full if the list is very large, causing the write to stdin to hang. The fix is to simply start the stdout/stderr reader threads before sending the file list to stdin. [newsham@frodo optional]$ pwd /home/newsham/jakarta-ant-1.5.1/src/main/org/apache/tools/ant/taskdefs/optional [newsham@frodo optional]$ diff Cab.java.old Cab.java 270,272d269 < out.write(sb.toString().getBytes()); < out.flush(); < out.close(); 284a282,285 > > out.write(sb.toString().getBytes()); > out.flush(); > out.close(); Thanks, Jim Newsham -- To unsubscribe, e-mail: For additional commands, e-mail: