Enscribe Programmer's Guide

= (CCE)
The operation was successful.
Error Numbers
An error number is associated with each call completion. As shown in Table 5, the error numbers
fall into three major categories. The setting of the condition code indicates the general category
of the error associated with a completed call.
Table 5 Error Number Categories
CategoryCondition CodeError Number
No error. The operation executed successfully.= (CCE)0
Warning. The operation executed with the exception of the indicated
condition. For warning 6 (system message received), data is returned in
the application process buffer.
> (CCG)1-9
Error. The operation encountered an error or a special condition (such
as a transaction abort for an audited file) that the application must
< (CCL)10-255, 512-32767
recognize. For data transfer operations, either none or part of the specified
data was transferred (except data communication error 165, which
indicates a normal completion with data returned in the application process
buffer).
Application-defined error. These error numbers are reserved for
use by application processes.
< (CCL)300-511
You can obtain the error number associated with an operation on an open file using the
FILE_GETINFO_ system procedure and passing the file number of the file in error:
status := FILE_GETINFO_ ( filenum, lasterror ) ;
The function value returned tostatus indicates the success of the call to FILE_GETINFO_. Usually
this value is 0 unless a programming error is made, such as supplying an invalid file number. The
error associated with the preceding operation (such as FILE_READ64_, READ, FILE_WRITE64_ or
WRITE) is returned to the second parameter ( lasterror ).
You can obtain the error number of a preceding AWAITIO[X]/FILE_AWAITIO64_ on any file or
of a waited FILE_OPEN_ that failed, using FILE_GETINFO_ with file number -1:
status := FILE_GETINFO_ ( -1, lasterror ) ;
Note that if the FILE_OPEN_ procedure fails, it sets the filenum parameter to -1.
Similarly, you can get the error number of a preceding FILE_CREATE_ or FILE_PURGE_ operation
that failed using FILE_GETINFO_ with filenum = -1.
File Access Permissions
The disk file must be open with read or read/write access for a FILE_READ64_, FILE_READLOCK64_,
FILE_READUPDATE64_, FILE_READUPDATELOCK64_, READ[X], READLOCK[X], READUPDATE[X],
or READUPDATELOCK[X] call to be successful; if not, the call is rejected with an error 49 (access
violation).
The disk file must be open with write or read/write access for CONTROL, FILE_CONTROL64_,
FILE_WRITE64_, FILE_WRITEUPDATE64_, FILE_WRITEUPDATEUNLOCK64_, WRITE[X],
WRITEUPDATE[X], or WRITEUPDATEUNLOCK[X] calls to be successful; if not, the call is rejected
with an error 49 (access violation).
The caller must have purge access to the disk file if FILE_PURGE_ or FILE_RENAME_ calls are to
be successful; otherwise the call is rejected with an error as 48 ( security violation).
File-System Procedures 43