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

Re: Flushing all Buffers Before Exiting



On 3/21/19, Martin McCormick <martin.m@suddenlink.net> wrote:
> 	I have been using unix of various flavors for 30 years so
> this is a bit of a bone-head question except that different
> styles of unix handle this situation somewhat differently.
>
> 	Imagine that you run a process whose output you want to
> catch so you run it as someproc >catchfile.  The process has an
> end point so anything it produced gets saved in catchfile and all
> is well.
>
> 	Now imagine you run someproc and it either has no end
> condition or you haven't reached it yet so you kill it with
> Control-C.  Some unixen like FreeBSD seem to flush all the
> buffers  and you still get your output but Debian appears to not
> flush the buffers and you get nothing or maybe a partial capture
> with the most recent data lost.
>
> 	Is there a way to make sure we got everything that was
> produced?

https://unix.stackexchange.com/questions/25372/turn-off-buffering-in-pipe/

Regards,
Lee


Reply to: