You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Steve Ebersole <st...@hibernate.org> on 2009/08/19 18:55:25 UTC

commons-exec and streams

I am having a problem with using commons-exec and having file output
streams end up containing truncated results.  

I have to assume that the streams are closed by the pump handler before
all the output it piped (or perhaps because there is no flush before
closing).  Here is my usage:
http://anonsvn.jboss.org/repos/labs/labs/jbossbuild/maven-plugins/tags/maven-jdocbook-plugin-2.2.0/src/main/java/org/jboss/jdocbook/i18n/gettext/TranslationBuilderImpl.java

@ the very end in the generateTranslatedXML method.

In digging in to the code, it seems that after Executor#execute() is
done processing the launched process, it already closes the streams
managed by the PumpStreamHandler so I don't think my explicit flush()
and close() in the finally block really have any effect.

Can someone outline the correct way to pipe stdout from a process
managed by Executor to a file such that the results are not truncated?


-- 
Steve Ebersole <st...@hibernate.org>
Hibernate.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: commons-exec and streams

Posted by Siegfried Goeschl <si...@it20one.at>.
Hi Steve,

as user of your dockook plugin I try to look into the issue - but I'm
will be on holidays the next few days ...

Cheers,

Siegfried Goeschl

Steve Ebersole wrote:
> I am having a problem with using commons-exec and having file output
> streams end up containing truncated results.  
>
> I have to assume that the streams are closed by the pump handler before
> all the output it piped (or perhaps because there is no flush before
> closing).  Here is my usage:
> http://anonsvn.jboss.org/repos/labs/labs/jbossbuild/maven-plugins/tags/maven-jdocbook-plugin-2.2.0/src/main/java/org/jboss/jdocbook/i18n/gettext/TranslationBuilderImpl.java
>
> @ the very end in the generateTranslatedXML method.
>
> In digging in to the code, it seems that after Executor#execute() is
> done processing the launched process, it already closes the streams
> managed by the PumpStreamHandler so I don't think my explicit flush()
> and close() in the finally block really have any effect.
>
> Can someone outline the correct way to pipe stdout from a process
> managed by Executor to a file such that the results are not truncated?
>
>
>   

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org