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

Flushing all Buffers Before Exiting



	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?

	I have noticed that the tee program in Debian also
appears to buffer data that get lost if you end early.

	Many thanks.

	Martin McCormick


Reply to: