1 | Integrated file system close exit information | Input | Char(*) |
2 | Status information | Output | Char(*) |
The integrated file system scan on close exit program is called to do scan processing when an integrated file system object is closed under the following conditions.
The exit program will not be called if:
If the previous conditions have been met, the exit program will be called if:
Note: If there are multiple descriptors referencing the same open instance of the object, then the exit program will only be called for the close request on the last descriptor. Additionally, the From CCSID of the object will be the value it is at the point in time of the close operation while the To CCSID will be reflective of the value specified at open.
For more information on close processing, see close()--Close File or Socket Descriptor. For more information on the scan-related attributes which can be set for objects, see Qp0lSetAttr()--Set Attributes. For more information on the integrated file system scan processing and various options, see the Integrated file system information in the Files and file systems topic.
The exit point supports a maximum of 50 exit programs. For information about adding an exit program to an exit point, see the Registration Facility.
Notes:
When you register the exit program, the following program data must be provided. The following table shows the structure of the program data information. For a description of the fields in this format, see Field Descriptions. This structure is defined in header file qp0lscan.h as data type Qp0l_Scan_Program_Data_t.
Offset | Type | Field | |
---|---|---|---|
Dec | Hex | ||
0 | 0 | Char(10) | User profile |
10 | A | Char(20) | Scan key |
30 | 1E | Char(12) | Scan key signature |
Information that is needed by the exit program to do its object scan processing. For details, see Format of Integrated File System Close Exit Information.
Information that is returned by the exit program indicating what scan processing has occurred. For details, see Format of Status Information.
The following table shows the structure of the integrated file system close exit information for exit point format SCCL0100. For a description of the fields in this format, see Field Descriptions. This structure is defined in header file qp0lscan.h as data type Qp0l_Scan_Exit_Information_t.
Offset | Type | Field | |
---|---|---|---|
Dec | Hex | ||
0 | 0 | BINARY(4) | Integrated file system close exit information length |
4 | 4 | CHAR(20) | Exit point name |
24 | 18 | CHAR(8) | Exit point format name |
32 | 20 | BINARY(4) | Length of status information |
32 | 20 | BINARY(4) | Scan descriptor |
36 | 24 | BINARY(4), UNSIGNED | From CCSID |
40 | 28 | BINARY(4), UNSIGNED | To CCSID |
44 | 2C | BINARY(4), UNSIGNED | Last failure CCSID |
48 | 30 | BINARY(4) | Oflags |
52 | 34 | CHAR(16) | File ID |
68 | 44 | CHAR(10) | Object type |
78 | 4E | CHAR(1) | File system |
79 | 4F | CHAR(1) | Additional call |
80 | 50 | CHAR(1) | Object modified since last scan |
81 | 51 | CHAR(1) | Scan signatures different |
82 | 52 | CHAR(1) | Call after previous failure |
The following table shows the structure of the status information. For a description of the fields in this format, see Field Descriptions. This structure is defined in header file qp0lscan.h as data type Qp0l_Scan_Status_Information_t.
Offset | Type | Field | |
---|---|---|---|
Dec | Hex | ||
0 | 0 | BINARY(4) | Close scan status information length |
4 | 4 | BINARY(4), UNSIGNED | Failing CCSID |
8 | 8 | CHAR(1) | Update object scan information |
9 | 9 | CHAR(1) | Scan status |
Additional call. Whether the exit program was called an additional time because another Integrated File System Scan on Close Exit Program that was called has indicated the object was modified. See the scan status field for this modify indication. The possible values are:
QP0L_SCAN_CALL_FIRST (x'00') | The first call to the exit program. |
QP0L_SCAN_CALL_ADDL (x'01') | An additional call to the exit program because another exit program has indicated the object was modified. |
Call after previous failure. Whether the exit program was called after the object had previously been scanned and a failure detected. The possible values are:
QP0L_SCAN_NO (x'00') | This is not a call after a previous scan failure. |
QP0L_SCAN_YES (x'01') | This is a call after a previous scan failure.
The Last failure CCSID field in conjunction with the
From CCSID indicate the CCSID or binary indication of the failing
scan request.
Note: If the Failing CCSID and From CCSID values match, it is the same as if the object would have been opened in binary. |
Close scan status information length. The length in bytes of all data returned from the integrated file system close exit program. The only valid value for this field is 10. If anything else is specified, the object will be treated as if the program was not called and the object was not scanned. Therefore, the close operation will continue unless the Scan file systems control (QSCANFSCTL) system value has *ERRFAIL specified which will cause the operation to fail. If the Scan file systems control (QSCANFSCTL) system value has *NOFAILCLO specified, the close operation will not return any failure indication. If *NOFAILCLO is not specified, the close operation will fail with error code [ESCANFAILURE].
Exit point format name. The format name for the integrated file system scan on close exit program. The possible format name follows:
SCCL0100 | The format name that is used while an object is being closed. |
Exit point name. The name of the exit point that is calling the exit program.
Failing CCSID. This field only has meaning if the Call after previous failure field had a value of QP0L_SCAN_YES when the exit program was called, and if the Update object scan information field has a value of QP0L_SCAN_YES, and if the Scan status field has a value of QP0L_SCAN_FAILURE or QP0L_SCAN_FAIL_WANT_MODIFY. When the Call after previous failure had a value of QP0L_SCAN_YES, then the scan exit program should verify that the object does not have any problems when scanned using both the To CCSID and Last failure CCSID values. If either scan fails, then this field should be filled in with the failing CCSID which will be stored as part of the object scan information with the failure indication. If the value of this field does not match either of the two input CCSID fields, then the To CCSID value will be used. If more than one exit program indicates a failure, the failing CCSID value which will be preserved is from the last exit program which scanned the object and indicated a failure. For more information on CCSIDs and conversions, see Coded Character Set Identifier (CCSID) Information in Integrated File System Scan on Open Exit Program.
Note: If the Failing CCSID and From CCSID values match, it is the same as if the object would have been opened in binary.
File ID. A unique identifier associated with the object that is being closed. A file ID can be used with Qp0lGetPathFromFileID()--Get Path Name of Object from Its File ID, to retrieve an object's path name.
File system. The file system that the object being scanned is in. The possible value follows:
QP0L_SCAN_ROOT_QOPENSYS_UDFS (x'00') | The object is in the "root" (/), QOpenSys, or a user-defined file system. |
From CCSID. The CCSID value that the data is in on the system itself at the point in time of the close operation. Therefore, this will be the CCSID in which data is to be returned (when reading from the object using the Scan descriptor), or the CCSID in which data is being supplied (when writing to the object using the Scan descriptor). For more information on CCSIDs and conversions, see Coded Character Set Identifier (CCSID) Information in Integrated File System Scan on Open Exit Program.
Integrated file system close exit information length. The length in bytes of all data passed to the integrated file system close exit program.
Last failure CCSID. The CCSID value that was specified when this object was last scanned and indicated a scan failure. This field only has meaning if the Call after previous failure field has a value of QP0L_SCAN_YES. Therefore, this would have been the CCSID in which data was to have been returned (when the user was to be reading from the object), or the CCSID in which data was to have been supplied (when the user was to be writing to the object). However, that request failed for this CCSID. This is now being returned so that this CCSID can also be scanned, if it is different than the To CCSID value. For more information on CCSIDs and conversions, see Coded Character Set Identifier (CCSID) Information in Integrated File System Scan on Open Exit Program.
Note: If the Last failure CCSID and From CCSID values match, it is the same as if the object would have been opened in binary.
Length of status information. The length in bytes allocated for the returned status information.
Object modified since last scan. Whether the exit program was called because the objects data or CCSID has been modified since it was last scanned. Examples of object data or CCSID modifications are: writing to the object, directly or through memory mapping; truncating the object; clearing the object; and changing the objects CCSID attribute, etc.. The possible values are:
QP0L_SCAN_NO (x'00') | The object has not been modified since it was last scanned. |
QP0L_SCAN_YES (x'01') | The object has been modified since it was last scanned. |
Object type. The object type. See Control Language (CL) information in the iSeries Information Center for descriptions of all object types.
Oflags. The oflags that were specified on the open request associated with this close request with the following exceptions. For a description of all possible oflag values, see open()--Open a File.
Scan descriptor. A descriptor representing the object that is being closed. This scan descriptor has the following characteristics:
Scan key. The scan key associated with this exit program. The first character of this scan key can not be hex zeros or a blank. For more information on the scan key, see Scan Key List and Scan Key Signatures in Integrated File System Scan on Open Exit Program.
Scan key signature. The scan key signature associated with the specified scan key. For more information on the scan key signature, see Scan Key List and Scan Key Signatures in Integrated File System Scan on Open Exit Program. If the specified scan key already exists in the scan key list, and the exit program is being added to replace an existing exit program entry, then the specified scan key signature must match the scan key signature associated with the scan key in the scan key list. If the specified scan key already exists in the scan key list, and the exit program is not being added to replace an existing exit program entry, then the specified scan key signature must match the scan key signature associated with the scan key in the scan key list unless the scan key signature associated with the scan key in the scan key list is all hex zeros. More than one exit program, including exit programs associated with the Integrated File System Scan on Open Exit Program, can have the same scan key signature.
Scan signatures different. Whether the exit program was called because the object's current scan key signature is different than the appropriate associated signature. When an object is in an independent ASP group, the object scan signature is compared to the associated independent ASP group scan signature. When an object is not in an independent ASP group, the object scan signature is compared to the global scan signature. The possible values are:
QP0L_SCAN_NO (x'00') | The compared signatures are not different. |
QP0L_SCAN_YES (x'01') | The compared signatures are different. |
Scan status. The status of the scan processing. This field is only used if the Update object scan information field value specifies a value of QP0L_SCAN_YES. The possible values are:
QP0L_SCAN_SUCCESS (x'01') | The object was scanned and has no failures. If this indicator is returned by all exit programs that were called, the object will be marked as scan successful, and the close operation completes with no errors. |
QP0L_SCAN_FAILURE (x'02') | The object was scanned and has at least one failure.
If this indicator is returned by at least one of the exit programs that was called,
the object will be marked as scan failure, and
the close operation fails.
Additionally, only the CCSID or binary indication related to this failing request will
be kept in the object scan information, and the rest of the historical CCSID or binary
information will be cleared.
Once an object has been marked as a failure under this condition, it will not be scanned again until the object's scan signature is different than the global scan key signature or independent ASP group scan key signature as appropriate. Therefore, subsequent requests to work with the object will fail with a scan failure indication. Examples of requests which will fail are opening the object, changing the CCSID of the object, copying the object etc.. |
QP0L_SCAN_FAIL_WANT_ MODIFY (x'03') | The object was scanned and has at least one failure. However,
the exit program wanted to modify the file to correct the failure, but could not
because it did not have write access.
If this indicator is returned by at least one of the exit programs that was called,
the object will be marked as scan failure, and
the close operation fails.
Additionally, only the CCSID or binary indication related to this failing request will
be kept in the object scan information, and the rest of the historical CCSID or binary
information will be cleared.
Once an object has been marked as a failure under this condition, it will not be scanned again until the object's scan signature is different than the global scan key signature or independent ASP group scan key signature as appropriate, or if a subsequent access would allow write access to be given to the exit program. Therefore, subsequent requests to work with the object will fail with a scan failure indication. Examples of requests which will fail are opening the object, changing the CCSID of the object, copying the object etc.. |
QP0L_SCAN_MODIFY (x'04') | The object was scanned, one or more failures were found, but the object was modified to remove the failures. If this indicator is returned by at least one of the exit programs that was called, then any exit programs which have previously been called will be called one more time so that they can scan the modified object information. This second call is indicated by an Additional call field value. If after this additional call, no failures are found, the object will be marked as scan successful, and the close operation completes with no errors. |
To CCSID. The CCSID value that was specified on the open request associated with this close request. Therefore, this will be the CCSID in which data was returned (when the user was reading from the object), or the CCSID in which data was be supplied (when the user was writing to the object). Therefore, the exit program should be converting the data to this CCSID since this is how the data was presented to the user after their open request completed. For more information on CCSIDs and conversions, see Coded Character Set Identifier (CCSID) Information in Integrated File System Scan on Open Exit Program.
Note: If the To CCSID and From CCSID values match, it is the same as if the object was opened in binary.
Update object scan information. Whether the scan information associated with the object should be updated or not. The object scan information includes the following:
Note: Actually, the last two To CCSID values which have been scanned will be maintained as well as a separate indication of binary scans.
The possible values are:
QP0L_SCAN_NO (x'00') | The object scan information should not be updated. This might be used when the object was not actually scanned by the exit program, perhaps because it did not need to be, or perhaps because a deferred scan was initiated. |
QP0L_SCAN_YES (x'01') | The object scan information should be updated. When this value is set, then the values in the Scan status field and Failing CCSID are used. If at least one exit program specified this value, then the object scan information will be updated. |
User profile. The exit program will be called under this user profile. Therefore, this user profile should have *USE authority to the exit program, and *EXECUTE authority to the exit program library. If the user profile is not valid or accessible at the time the exit program is called, the object will be treated as if the program was not called and the object was not scanned. Therefore, the close operation will continue unless the Scan file systems control (QSCANFSCTL) system value has *ERRFAIL specified which will cause the operation to fail. If the Scan file systems control (QSCANFSCTL) system value has *NOFAILCLO specified, the close operation will not return any failure indication. If *NOFAILCLO is not specified, the close operation will fail with error code [ESCANFAILURE]. The first character of the user profile can not be hex zeros or a blank.
Note: The system will not do any additional verification that this specified profile has authority to the object for which the exit program is being called when that exit program is being called, even when the access levels for the object are upgraded to include write. By registering this exit program, you are indicating this is acceptable.
Therefore, when the following APIs are called from the thread executing the exit program and any of its created threads, the descriptors returned by these APIs will only work within the same process.
Top | Integrated File System APIs | APIs by category |