Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Why doesn't the Eclipse console stream?
Why doesn't the Eclipse console stream? [message #329793] Fri, 04 July 2008 10:51 Go to next message
Gabriel Petrovay is currently offline Gabriel PetrovayFriend
Messages: 42
Registered: July 2009
Member
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 #329795 is a reply to message #329793] Fri, 04 July 2008 11:58 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33251
Registered: July 2009
Senior Member
Gabriel,

Maybe you should call OutputStream.flush in the code to ensure that it's
not buffered...


Gabriel wrote:
> 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
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Why doesn't the Eclipse console stream? [message #329796 is a reply to message #329795] Fri, 04 July 2008 12:08 Go to previous messageGo to next message
Gabriel Petrovay is currently offline Gabriel PetrovayFriend
Messages: 42
Registered: July 2009
Member
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!
Re: Why doesn't the Eclipse console stream? [message #329797 is a reply to message #329796] Fri, 04 July 2008 12:31 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33251
Registered: July 2009
Senior Member
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!
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Content types with 'multiple' extensions
Next Topic:Re: build map files for ecf ganymede build
Goto Forum:
  


Current Time: Sat Nov 02 16:57:44 GMT 2024

Powered by FUDForum. Page generated in 0.03354 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top