C/C++ Programmer's Guide (G06.27+, H06.03+)

Table Of Contents
Using the C Run-Time Library
HP C/C++ Programmer’s Guide for NonStop Systems429301-010
4-4
Physical File Types
Physical File Types
As mentioned earlier, the C run-time library provides input and output access to several
types of physical files, including C files, EDIT files, processes, and terminals. These
subsections describe these physical file types and specify which logical types you can
use to access each of the physical types.
C Files
C files are odd-unstructured disk files with a file code of 180 when stored in the
Guardian file system. Because C files are odd-unstructured (rather than simply
unstructured), they are byte-addressable; that is, you can read, write, and position to
single bytes instead of words.
When accessing a C file, use either the text or the binary logical type.
Opening a C file as a text file causes subsequent writes and reads to transfer the exact
number of characters specified, including trailing blanks.
Edit Files
When accessing an EDIT file, you must use the text logical type. Due to their
physical structure, EDIT files are only line-addressable. Consequently, an error occurs
if you attempt to disable line buffering of an EDIT file.
Because EDIT files do not physically contain newline characters, the run-time library
automatically adds them on input and removes them on output. This addition of
newlines makes the EDIT file truly accessible as a text file.
It is a standard feature of EDIT files that trailing blanks are stripped from each line.
Table 4-1. Buffer Sizes
File Type Maximum Length of Buffer in Bytes
Terminals 239
EDIT files 239
C file accessed as text-type logical file 256
C file accessed as binary-type logical file 4096
Process accessed as text-type logical file 256
Process accessed as binary-type logical file 32,767
$RECEIVE 32,767