Enscribe Programmer's Guide

Next-record pointer = record number or address that follows the current-record pointer.
For entry-sequenced files, the record pointers contain a record address; for relative files, the record
pointers contain a relative record number. The contents of the current-record and next-record
pointers are accessible with the FILE_GETINFOLIST_ system procedure.
Following a call to FILE_READ64_/READ when reverse-positioning mode is in effect, the next-record
pointer contains the record number or address that precedes the current record number or address.
Following a read of the first record in a file (where the current-record pointer is 0) when
reverse-positioning mode is in effect, the next-record pointer contains an invalid record number or
address because no previous record exists. In such a case, a subsequent call to FILE_READ64_/READ
will result in a CCG completion with file-system error code 1 (EOF) and a call to
FILE_WRITE64_/WRITE results in a file-system error code 550 (illegal position) because an attempt
was made to write beyond the beginning of the file.
File Expiration Dates
Each file has an associated expiration date value in the form of a 4-word timestamp. For purge
operations this value is checked against the current time; if it is later than the current time, the purge
is disallowed and a 1091 error code is returned. This check is in addition to, and separate from,
the usual purge authority checking. You can set the expiration date of a file by using the
FILE_ALTERLIST_ system procedure with an item code of 57. The initial expiration date value when
a file is created is zero, which represents a date far in the past, so all files are initially purgeable
as far as the expiration date is concerned.
NOTE: Any Enscribe files existing before the C10 software release are presumed to have a zero
expiration date.
When you change the expiration date of a file, it is not changed for any associated alternate-key
files but is changed for the secondary partitions of a partitioned file (unless the partonly parameter
was set to 1 in the FILE_ALTERLIST_ call). You must have read and write authority to change the
expiration date of a file. In addition, you cannot set an expiration date for a temporary file because
such files are automatically purged when you close them.
File Creation and Last-Opened Timestamps
Each file has associated with it a creation date value and a last-opened date value in the form of
4-word timestamps.
You can obtain the creation date or last-opened date of a file by issuing a FILE_GETINFOLIST_
procedure call.
Using CONTROL 27 to Detect Disk Writes
For nonpartitioned files, you can use the CONTROL/FILE_CONTROL64_ system procedure with
a function code of 27 to detect when a disk write operation (FILE_WRITE64_,
FILE_WRITEUPDATE64_, FILE_WRITEUPDATEUNLOCK64_, WRITE, WRITEUPDATE, or
WRITEUPDATEUNLOCK) completes for the file designated by the specified file number.
This procedure call is useful in application environments where several different processes are
accessing the same database files and where you must quickly determine that the content of certain
critical records has changed.
Note that a CONTROL 27 call completion does not guarantee that any data in the file has actually
changed; it merely indicates that a disk write has completed against the file and it is a reasonable
time to examine the critical record(s) for new data.
To assure that no updates are missed as you read a record, first issue a nowait CONTROL 27 call
against the file through one file open, read the record through another file open, and then check
for a completion of the CONTROL 27 call. If you issued the CONTROL 27 call after reading the
File Access 53