On 2015-11-25, LCD 47 wrote:

[...]

>     You can make stdout unbuffered:
> 
>         #include <stdio.h>
> 
>         int main()
>         {
>             setbuf(stdout, NULL);
>             printf("This is a message on stdout and should appear first\n");
>             fprintf(stderr, "This is a message on stderr and should appear 
> second\n");
> 
>             return 0;
>         }
> 
> or you can flush stdout before writing to stderr:
> 
>         #include <stdio.h>
> 
>         int main()
>         {
>             printf("This is a message on stdout and should appear first\n");
>             fflusf(stdout);
>             fprintf(stderr, "This is a message on stderr and should appear 
> second\n");
> 
>             return 0;
>         }
> 
>     But you can only do this because you can recompile the program.  If
> you can't change the program you're out of luck.  You can't fix the
> problem without changing the program itself.

Thanks for the explanations and clearing up my misunderstandings.

There may be a solution that doesn't require modifying and
recompiling the program:  run the program under unbuffer or stdbuf.

http://linux.die.net/man/1/unbuffer
http://linux.die.net/man/1/stdbuf

Regards,
Gary

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui