2 freopen - close (if necessary) and reopen a filestream
5 freopen(fs, mode) or freopen(fs, mode, filename)
8 fs open or closed file stream
9 mode one of the strings "r", "w", "a", "r+", "w+, "a+"
12 return null or error value
15 With two arguments, this function closes the file stream fs and
16 attempts to reopen it with the specified mode. A non-null value
17 is returned only if the attempt fails.
19 With three arguments, fs, if open, is closed, and an attempt is made to
20 open the file with the specified name and assign it to the stream
21 fs. A non-null value is returned only if the attempt fails.
25 > f = fopen("/tmp/junk", "w")
26 > fputs(f, "Leonard Euler")
30 > !chmod u-w /tmp/junk
35 none - XXX - is this correct?
38 none - XXX - is this correct?
41 errno, fclose, feof, ferror, fflush, fgetc, fgetline, fgets, files, fopen,
42 fprintf, fputc, fputs, fseek, fsize, ftell, isfile, printf, prompt