[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

Re: Re: How to decrease the buffer size

sarcar@xxxxxxxx forced the electrons to say:
> The '\n' flushes the o/p buffer.

Only if the stream is line buffered. In case of block buffered streams, the \n
doesn't matter at all, it will still wait for the buffer to be full. The
BUFSIZ on my machine is 8192. In case of unbuffered streams, well...

OK, since you mentioned printf, you are writing to stdout, which is line
buffered if it refers to a terminal. Files are usually block buffered. stderr
is unbuffered by default. So, \n will not work in the case of files, and is
as good as any other character in the case of stderr.


The prompt for all occasions:
export PS1="F:\$(pwd | tr '/[a-z]' '\134\134[A-Z]')> "
--------------- Binand Raj S. (binand@xxxxxxxxxxxxxxxxxxxxx)