setvbuf()

This is a File I/O function. It is not implemented in the Compiler.

Syntax
  #include <stdio.h>

  
  void setvbuf(FILE *f,

  
               char *buf,

  
               int mode,

  
               size_t size);

  
Description

setvbuf() is used to specify how a file is buffered. mode determines how the file is buffered.

Table 1. Operating Modes for the setvbuf() Function
Mode Buffering
_IOFBF Fully buffered
_IOLBF Line buffered
_IONBF Unbuffered

To make a file unbuffered, call setvbuf() with mode _IONBF; the other arguments ( buf and size) are ignored.

In all other modes, the file uses buffer buf of size size. If buf is NULL, the function allocates a buffer of size size itself.

See also

fflush() and

setbuf()