1 | Operation (CPYSF) | Input | Char(5) |
2 | File system job handle | Input | Char(16) |
3 | Reserved | Input | Char(20) |
4 | Source file path name | Input | Char(*) |
5 | Source file path name length | Input | Binary(4) |
6 | Copy information | Input | Char(6) |
7 | Target file path name | Input | Char(*) |
8 | Target file path name length | Input | Binary(4) |
9 | File system names | Input | Char(20) |
Before applications can use the Copy Stream File (QHFCPYSF) API with your file system, you must:
After that, when an application calls the QHFCPYSF API, the API calls your exit program and passes it the parameters specified by the application. Your exit program performs the work and returns any data to the API. The API passes the data back to the calling application.
None.
The API passes this information to your exit program:
The abbreviation for the operation being performed (CPYSF).
The work area or job identifier for use by the file system.
Reserved for future use. This parameter is set to blanks.
Except as noted, the following parameters are the same as the parameters for the API.
The API removes the file system name before passing the path name to the exit program.
The API removes the file system name before passing the path name to the exit program.
This is not an API parameter. The API derives this information from its source and target file path name parameters. The first 10 characters contain the name of the source file system, and the second 10 characters contain the name of the target file system.
The QHFCPYSF API performs the standard functions described in Standard HFS API Functions.
When the source and target file systems are different, the API performs additional functions so that the file is copied by the most efficient means available. The following diagram outlines the processing steps. The steps are the same for copy and move operations. They are described in detail after the diagram.
After determining that the file systems differ, the API tries to perform the copy operation in several different ways. If a method fails, the API proceeds to the next method. The possible methods are to call the following exit programs in the sequence listed:
The following paragraphs describe each method in detail.
First, the API checks the information provided when the source file system was registered with the Register File System (QHFRGFS) API. The copy or move indicator is character 2 of the registration-information parameter described in the Register File System (QHFRGFS) API.
If the value of the source file system's copy or move indicator is 0 for no (indicating that this file system has no cross-file-system capability), the API proceeds to try the target file system.
If the value of the source file system's copy or move indicator is 1 for yes (indicating that this file system has some cross-file-system capability), the API calls the file system's Copy Stream File exit program.
If the exit program encounters an error in communicating with the source file system--for example, the exit program can work with some other file systems but not with this one--it returns message CPF1F88 to the API, which proceeds to the target file system.
If the exit program completes the copy or encounters any other type of error--for example, the exit program cannot find the file to be copied--it returns control to the API. The API resends any errors received from the exit program to the application and then returns control to the application.
The API follows the same procedure as for the source file system, checking the copy or move indicator and then trying the target file system's Copy Stream File exit program. If the copy or move indicator is 0 for no or if the exit program returns message CPF1F88, the API proceeds to try the other exit programs.
If the source and target file systems' Copy Stream File exit programs have no cross-file-system capability at all, or if they have no such capability with respect to each other, the API might be able to perform a less efficient form of copy operation. If the following exit programs exist in the source and target file systems, the API tries to perform the copy operation. If any of these exit programs do not exist, the API returns message CPF1F82 and returns control to the application without performing the copy operation.
The required exit programs in the source file system are:
The required exit programs in the target file system are:
The API uses the exit programs to perform their ordinary functions:
The target file system's Delete Stream File exit program is used during unsuccessful copy and move operations. If errors cause the failure of the operation as a whole, the exit program deletes any incomplete target files created during the operation. Target files that existed before the operation began are not deleted but might be partly changed.
You must create an exit program that performs the standard functions described in Standard HFS Exit Program Requirements and these additional functions:
When the exit program has some cross-file-system capability but cannot complete this specific copy operation, it should return message CPF1F88 to the API. This tells the API that it might still be possible to perform the copy operation by other means. If unavoidable errors occur--for example, if the file being copied does not exist--then the exit program should return those errors to the API.
Whether or not the QHFCPYSF API calls this exit program for cross-file-system operations depends on information provided when this file system was registered. If the second character of the registration-information parameter of the Register File System (QHFRGFS) API has a value of 1 (yes), the QHFCPYSF API calls this exit program. If that character has a value of 0 (no), the QHFCPYSF API does not call this exit program for cross-file-system operations; instead, the API bypasses this exit program and proceeds to try the next available method of copying files.
This section lists the messages that the exit program can return to the API.
Message ID | Error Message Text |
---|---|
CPF1F01 E | Directory name not valid. |
CPF1F02 E | Directory not found. |
CPF1F06 E | Directory in use. |
CPF1F07 E | Authority not sufficient to access directory. |
CPF1F08 E | Damaged directory. |
CPF1F21 E | File name not valid. |
CPF1F22 E | File not found. |
CPF1F23 E | New file name same as old file name. |
CPF1F24 E | File name already exists. |
CPF1F26 E | File in use. |
CPF1F27 E | Authority not sufficient to access file. |
CPF1F28 E | Damaged file. |
CPF1F29 E | Use of reserved file name not allowed. |
CPF1F41 E | Severe error occurred while addressing parameter list. |
CPF1F48 E | Path name not valid. |
CPF1F51 E | Copy information value not valid. |
CPF1F61 E | No free space available on media. |
CPF1F62 E | Requested function failed. |
CPF1F63 E | Media is write protected. |
CPF1F66 E | Storage needed exceeds maximum limit for user profile &1. |
CPF1F71 E | Exception specific to file system occurred. |
CPF1F73 E | Not authorized to use command. |
CPF1F74 E | Not authorized to object. |
CPF1F75 E | Error occurred during start-job-session function. |
CPF1F77 E | Severe parameter error occurred on call to file system. |
CPF1F88 E | Unable to complete copy or move operation. |
Note: You can use message CPF1F88 only when trying to perform cross-file-system copy operations. If you use it when copying files within a single file system, an Internal file system error message is returned to the application. You can use the exit program's file-system-names parameter to determine whether the move is across file systems.
Because this message does not always indicate an error, the application calling the QHFCPYSF API does not receive it. It is used only to communicate between the file system's exit program and the API.
Top | Hierarchical File System APIs | APIs by category |