libc.info: freopen

Go forward to fseek
Go backward to fread
Go up to Stdio
Go to the top op libc

`freopen'--open a file using an existing file descriptor

*Synopsis*
     #include <stdio.h>
     FILE *freopen(const char *FILE, const char *MODE,
         FILE *FP);
   *Description*
Use this variant of `fopen' if you wish to specify a particular file
descriptor FP (notably `stdin', `stdout', or `stderr') for the file.
   If FP was associated with another file or stream, `freopen' closes
that other file or stream (but ignores any errors while closing it).
   FILE and MODE are used just as in `fopen'.
*Returns*
If successful, the result is the same as the argument FP.  If the file
cannot be opened as specified, the result is `NULL'.
*Portability*
ANSI C requires `freopen'.
   Supporting OS subroutines required: `close', `fstat', `isatty',
`lseek', `open', `read', `sbrk', `write'.