Perform Miscellaneous File System Functions (QP0FPTOS) API
Required Parameter Group:
| 1 | Function type | Input | Char(*) |
| 2 | Function extension 1 | Input | Char(*) |
| 3 | Function extension 2 | Input | Char(*) |
| 4 | Function extension 3 | Input | Char(*) |
Default Public Authority: *USE
Threadsafe: No
The Perform Miscellaneous File System Function (QP0FPTOS) API is used to perform a variety of file system functions. The first parameter defines the type of function that is requested. Other parameters are optional, depending on the selected function. The output from this API varies, based on the selected function. See the function descriptions for more details.
Authorities and Locks
To call this program you must have *SERVICE special authority, or be authorized to the Service Dump function of IBM® i through System i® Navigator's Application Administration support. The Change Function Usage (CHGFCNUSG) command or Change Function Usage Information (QSYCHFUI) API, with a function ID of QIBM_SERVICE_DUMP, also can be used to change the list of users allowed to perform dump operations.
Note: Adopted authority is not used.
Required Parameter Group
Required parameters vary according to the selected function. The selected function is identified by the first parameter on the call to the API.
- Function Type
- INPUT; CHAR(*)
The desired file system function to perform. Valid values follow:
- (1) *DUMP
- Creates a general file system dump in a spooled file with file name
"QSYSPRT" and with "QP0FDUMP" in the User Data field. No other parameters are
required or supported when *DUMP is specified.
- (2) *DUMPALL
- Creates a variety of file system dumps in a single spooled file with file
name "QSYSPRT" and with "QP0FDUMP" in the User Data field. The following table
describes the optional parameter when *DUMPALL is specified.
Function Function extension 1 Description *DUMPALL Job number (CHAR 6) Specifies the job that is dumped. If a job is not specified, the data is dumped for all jobs. If there are multiple jobs with the same number, the first one encountered will be dumped.
- (3) *DUMPLFS
- Creates a dump of logical file system data in a spooled file with file name
"QSYSPRT" and with "QP0FDUMP" in the User Data field. The following table
describes the optional parameter when *DUMPLFS is specified.
Function Function extension 1 Description *DUMPLFS Job number (CHAR 6) Specifies the job that is dumped. If a job is not specified, the data is dumped for all jobs. If there are multiple jobs with the same number, the first one encountered will be dumped.
- (4) *NFSFORCE
- Sets various values and modes for the network file system. The following
table describes the required parameters when *NFSFORCE is specified.
Function Function extension 1 Function extension 2 Description *NFSFORCE V2 ON or OFF If ON, indicates version 2 mounts only by the client. If QNFSMNTD is started afterwards, then server will permit version 2 mounts only.
- (5) *REBUILDDEVNULL
- Attempts to create the /dev/null and dev/zero character special files. If
an existing dev/null or dev/zero object exists that is not a character special
file, then the object is renamed to /dev/null.prv or dev/zero.prv. If
/dev/null.prv or /dev/zero.prv exists, then it it renamed to /dev/null.prv.001
or /dev/zero.prv.001, /dev/null.prv.002 or /dev/zero.prv.002, and so on, until
a name is found for the object. If 999 is exceeded and the rename cannot be
done, the object is not renamed and an informational message is issued and the
QP0FPTOS program completes successfully. No other parameters are required or
supported when *REBUILDDEVNULL is specified.
- (6) *TRACE6ON or *TRACE6OFF
- *TRACE6ON starts the logging of trace messages in the user job log for some
network file system functions. *TRACE6OFF stops the logging of these
messages.
- (7) *TRACE8ON or *TRACE8OFF
- *TRACE8ON starts the logging of trace messages to the QSYSOPR message queue
for some network file system functions. *TRACE8OFF stops the logging of these
messages.
- (8) *TRACE9ON or *TRACE9OFF
- *TRACE9ON starts the collection of some network file system statistics and
resets the statistics. *TRACE9OFF stops the collection of these statistics.
- (9) *DUMPNFSSTATS
- Creates a file system dump of network file system (NFS) statistics (both
client and server) in a spooled file with file name "QSYSPRT" and with
"QP0FDUMP" in the User Data field. The information dumped comes from a window
of time specified with the *TRACE9ON/OFF function. No other parameters are
required or supported when *DUMPNFSSTATS is specified.
- (10) *DUMPDIR
- Creates a dump of the contents of a specified directory in a spooled file
with the file name "QSYSPRT" and with "QP0FDUMP" in the User Data field. Each
entry in the specified directory is printed in the current job CCSID and also
in its hexadecimal Unicode representation. This representation can be used with
the *RENAME function described below. Also, the presence and number of any problem
characters in the entry is indicated. These are characters that might cause
problems when attempting to use the entry name on various interfaces. The following
characters are identified as problems: slash (/), backslash (\), tilde (~),
asterisk (*), question mark (?), colon (:), single-quote or apostrophe ('),
double-quote (") and blank ( ).
Also, any characters that can not be represented in the current job CCSID are identified
as problems. The following table describes the required and optional parameters
when *DUMPDIR is specified.
Function Function extension 1 Function extension 2 Description *DUMPDIR Path name (CHAR *) *PRBONLY (optional) The path name of the directory to be dumped is required. If function extension 2 is not specified, then all entries in the specified directory will be dumped. If function extension 2 is specified, it must have the value, *PRBONLY. If *PRBONLY is specified, then only entries with the problem characters described above will be dumped.
- (11) *RENAME
- Rename a link in the current working directory. The following
table describes the two required parameters when *RENAME is specified.
Function Function extension 1 Function extension 2 Description *RENAME Old name (CHAR *) New name (CHAR *) The old name is the hexadecimal representation of the name in CCSID 1200 (UTF-16) that is obtained from the *DUMPDIR output. The new name is a name specified in the current job CCSID.
- (12) *RENAMEPRB
- Renames all objects in a specified directory or sub-tree that are affected by
a specified "problem" as identified by the *DUMPDIR function. The link names are
renamed such that the problem characters are changed to dashes (-). The activity
of the function is recorded in a spool file. The following table describes the
required parameter and two optional parameters when *RENAMEPRB is specified.
Function Function extension 1 Function extension 2 Function extension 3 Description *RENAMEPRB Path name (CHAR *) Subtree (CHAR *) Problem string (CHAR *) Function extension 2 optionally indicates whether to rename all objects in the entire subtree of the path. If *NONE is specified only the contents of the specified directory will be processed. If *ALL is specified, the contents of the specified directory as well as all of its subdirectories will be processed. If function extension 2 is not specified, subdirectories will not be processed. Function extension 3 optionally indicates the problem(s) to be corrected. This string can include any or all of the following characters, in any order:
- '/' - correct names with slashes
- '\' - correct names with backslashes
- '?' - correct names with question marks
- '*' - correct names with asterisks
- ':' - correct names with colons
- 'S' - correct names with single-quotes or apostrophes (')
- 'D' - correct names with double-quotes (")
- '~' - correct names with tildes
- 'B' - correct names with blanks
- 'C' - correct names with characters that do not convert to the current job CCSID
- Function extension 1
- INPUT; CHAR(*)
Function extension 1 is optional or required, based on the first parameter. Whenever it is valid, function extension 1 is described above along with a first parameter description. Function extension 1 is valid when the first parameter is listed below:
(1) *DUMPALL
(2) *DUMPLFS
(3) *NFSFORCE
(4) *DUMPDIR
(5) *RENAME
(6) *RENAMEPRB
- Function extension 2
- INPUT; CHAR(*)
Function extension 2 is optional or required, based on the first parameter. Whenever it is valid, function extension 2 is described above along with a first parameter description. Function extension 2 is valid when the first parameter is listed below:
(1) *NFSFORCE
(2) *DUMPDIR
(3) *RENAME
(4) *RENAMEPRB
- Function extension 3
- INPUT; CHAR(*)
Function extension 3 is optional or required, based on the first parameter. Whenever it is valid, function extension 3 is described above along with a first parameter description. Function extension 3 is valid when the first parameter is listed below:
(1) *RENAMEPRB<
Usage Notes
If this API is called without the first parameter that is required, then message CPFBC53 is issued to the caller. This message specifies a parameter that is not valid. To recover, the caller is pointed to the API documentation.
Error Messages
| Message ID | Error Message Text |
|---|---|
| CPE3418 E | Possible APAR condition or hardware failure. |
| CPF9872 E | Program or service program &1 in library &2 ended. Reason code &3. |
| CPFA0A0 E | Object name already exists. |
| CPFA0D4 E | File system error occurred. Error number &1. |
| CPDA0FF E | Program not called. You need *SERVICE authority to call this program. |
| CPFBC53 E | Invalid parameter. |
| CPFBC54 E | Not authorized to call program. |
Examples
Note: By using the code examples, you agree to the terms of the Code license and disclaimer information.
| CALL QP0FPTOS *DUMP |
| CALL QP0FPTOS (*DUMPALL '055229') |
| CALL QP0FPTOS (*DUMPLFS '055229') |
| CALL QP0FPTOS (*NFSFORCE V2 ON) |
| CALL QP0FPTOS *REBUILDDEVNULL |
| CALL QP0FPTOS *TRACE6ON |
| CALL QP0FPTOS *TRACE6OFF |
| CALL QP0FPTOS *TRACE8ON |
| CALL QP0FPTOS *TRACE8OFF |
| CALL QP0FPTOS *TRACE9ON |
| CALL QP0FPTOS *TRACE9OFF |
| CALL QP0FPTOS *DUMPNFSSTATS |
CALL QP0FPTOS (*DUMPDIR '/a/b/c') |
| CALL QP0FPTOS (*DUMPDIR '/a/b/c' *PRBONLY) |
| CALL QP0FPTOS (*RENAME '0041002F0042' 'ABC') |
| CALL QP0FPTOS (*RENAMEPRB '/a/b/c') |
| CALL QP0FPTOS (*RENAMEPRB '/a/b/c' *ALL) |
| CALL QP0FPTOS (*RENAMEPRB '/a/b/c' *NONE *ALL) |
| CALL QP0FPTOS (*RENAMEPRB '/a/b/c' *ALL 'C/\')
|
API introduced: V5R2
| Top | Miscellaneous APIs | APIs by category |