Accessing Files Programmer's Guide (32650-90885)

Chapter 2 41
Creating A File
The HPFOPEN Intrinsic
With NOBUF access, responsibility for blocking and deblocking of records in
the file belongs to the program. To be consistent with files built using
buffered I/O, records should begin on half word boundaries. When the
information content of the record is less than the defined record length,
you must pad the record with blanks if the file is ASCII, or with zeros if
the file is binary.
The record size and block size for files manipulated with NOBUF specified
follow the same rules as those files that are created using buffering. The
default blocking factor for a file created under NOBUF is one.
If a file is opened NOBUF without multirecord mode specified in
itemnum
=15, then transfer a maximum of only one block of data per read
or write.
The end-of-file (EOF) marker, next record pointer, and record transfer
count are maintained in terms of logical records for all files. The number of
logical records affected by each transfer is determined by the size of the
transfer.
Transfers always begin on a block boundary. Those transfers that do not
transfer whole blocks leave the next record pointer set to the first record in
the next block. The EOF marker always points at the last record in the file.
For files you have opened NOBUF, the FREADDIR, FWRITEDIR, and FPOINT
intrinsics treat the
recnum
parameter as a block number.
Indicate non-RIO access to an RIO file by specifying the file NOBUF. Use the
physical block size from FFILEINFO to determine the maximum transfer
length.
For message files, the file system normally resets
itemnum
=46 to zero.
However, a message file can be opened with NOBUF if
itemnum
=17 is set to
1; this determines access to the file record-by-record or by block.
If writing to a message file, open it NOBUF if
itemnum
=17 to access the file
block-by-block.
Native byte stream access opens NOBUF (1) regardless of the value specified
for this
itemnum
. This
itemnum
is ignored for directories since a physical
block transfer interface is not provided for directories.
(ASC) Not used for asynchronous devices.
47/I32 Numextents:
Passes a value in the range 1..32 that determines the number of extents
for the file. If a value of 1 is specified, the file is created as one contiguous
extent of disk space. If a value greater than 1 is specified, a variable
number of extents (with varying extent sizes) is allocated on a need basis.
This option is applicable only at file creation.
(ASC) Not used for asynchronous devices.
Default: 1
This
itemnum
may not be specified when creating hierarchical directories.