help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: get stdout/stderr while running a program


From: kgold
Subject: Re: get stdout/stderr while running a program
Date: 2 Dec 2002 14:48:25 GMT

emacs uses a pipe to route stdout to the buffer.  The C default for
pipes is fully buffered.  So you don't see the output until exit or
the buffer is full.

Put this into your C program main():

    setvbuf(stdout,0,_IONBF,0);

I'm not sure about stderr, since I thought it was unbuffered by
default..

Nagash <nagash2270@yahoo.de> writes:
> 
>   i've got a small problem with c-programs writing on
>   stdout/stderr. i cannot see the output while running the
>   program over the emacs shell access.
>   after exiting the program the buffer gets filled.
>   a simultaneous output mode would be nice for debug...

-- 
Ken Goldman   kgold@watson.ibm.com   914-784-7646


reply via email to

[Prev in Thread] Current Thread [Next in Thread]