By default, is STDOUT unbuffered? If not what is the type of its default buffering
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You didn’t give a language, but assuming that you’re using C’s stdio functions (
fopen()etc.) or a language that uses these (and most do, for portability reasons):It depends on the underlying C runtime library.
Most libraries will try to detect whether STDOUT is connected to a terminal, and avoid buffering if so, and perform block buffering (e.g. my Linux system buffers 8Kb at a time) if not.