HP C/iX Library Reference Manual (30026-90004)

176 Chapter5
HP C/iX Library Function Descriptions
freopen
R
n
The R option specifies the size of the record if the file is created by this
open request. If the V option is also used, this option specifies the
maximum size of the variable sized records. The option letter is followed
by a decimal number that is equal to the number of bytes in the record
size. Notice that the number must be positive. A byte count is always
specified. The default for text and binary streams is 256 bytes. The default
for byte streams is 1 byte.
S
n
The S option specifies the maximum size of the file. The value of
n
is the
maximum size of the file in records for text and binary streams, and in
bytes for byte streams. The default for text and binary streams is 4095
records. The default for byte streams is 2 gigabytes.
Te If the Te option is specified, the file is saved in the temporary file domain.
If the Te option is not specified and the file is a new file, the default is to
save the file as a permanent file. If the file is old, the default is to not
change the disposition.
Tm If the Tm option is specified, disk read functions trim editor line numbers, if
they exist, and trailing blanks from each record of an ASCII fixed record
length file before returning file data to the reader. This option is used on
files opened with read only access. Random access to file data using
fseek() and lseek(), is not permitted. The default is not to trim editor
line numbers and blanks.
U
n
If the U option is specified, the file is created with
n
user-label records. If
this option is not specified, the default is no user-label records.
V If the V option is specified, the file is created with an MPE variable-length
record format. This option is mutually exclusive with the Bs option. If the
V or Bs options are not specified, then the file is created with an MPE
fixed-length record format.
X
n
The X option controls exclusive access ability for the file. The option
character is followed by an integer that indicates the level of exclusivity
for this open request. The levels are specified in the MPE/iX Intrinsics
Reference Manual under the FOPEN intrinsic description.
The following example creates or opens a stream associated with a fixed record ASCII file
for writing with 80-byte records and a file size of 1000 records:
#include <stdio.h>
FILE *
stream
;
stream
=
freopen
("
filename
","w R80 S1000",stdout);
See Also
fclose(), fopen(), fflush(), ANSI C 4.9.5.4, POSIX.1 8.1