ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: create cab in linux; patch request
Date Thu, 10 Oct 2002 23:20:50 GMT
  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
[newsham@frodo optional]$ diff
<                 out.write(sb.toString().getBytes());
<                 out.flush();
<                 out.close();
 >                 out.write(sb.toString().getBytes());
 >                 out.flush();
 >                 out.close();

Jim Newsham

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message