Why doesn't the Eclipse console stream? [message #329793] |
Fri, 04 July 2008 06:51  |
Eclipse User |
|
|
|
Hi all,
Does anybody know why the Eclipse console does not stream the output of a
process? I have a plug-in and I run an external process and plug it in
Eclipse with:
Process process = DebugPlugin.exec(commandLine, workingDir);
IProcess p = DebugPlugin.newProcess(launch, process, "label");
if I execute the command line in the OS command prompt/terminal the output
is streamed. But in eclipse it waits until it about 4096 chars (4094,
4095) and only then it prints it to the console.
Does anybody know how can I disable this buffer or configure the console
such that the output of the process is immediately seen?
Thanks for the help,
Gabriel
|
|
|
|
|
Re: Why doesn't the Eclipse console stream? [message #329797 is a reply to message #329796] |
Fri, 04 July 2008 08:31  |
Eclipse User |
|
|
|
Gabriel,
When a print stream is created, it can support auto flushing (via a
constructor parameter). In that case, it seems to auto flush only for
line feeds and when the buffer is exceeded. I don't know how to force
the creation of an auto flushing stream for your scenario; it seems to
me an auto flushing stream should be created for your. But, in general
it seems best, at least to me, to assume that a stream is not auto
flushing and hence to add flushes where they are important; perhaps
that's not realistic for your application though...
Gabriel wrote:
>
> Hi Ed, thanks for the reply.
>
> Here are some more details: the Eclipse console is only flushing one
> line at a time or for long lines every 4KB. My external process can
> produce long lines, more than 12k (which causes Eclipse to generate an
> IOConsole Updater error). Can I force somehow Eclipse to flush more
> often during a line and also, does anybody know how to solve the
> "IOConsole Updater error" problem? Is this still a bug in 3.4?
>
> Thanks!
>
|
|
|
Powered by
FUDForum. Page generated in 0.03194 seconds