|Where allowed to run: All environments (*ALL)
The Retrieve Directory Information (RTVDIRINF) command is used to collect attributes for directories and files in the Integrated File System. The collected information is stored in database files that are named using the information file prefix specified by the INFFILEPFX parameter. The files are created in the library specified by the INFLIB parameter.
You can run the Print Directory Information (PRTDIRINF) command to print reports using the retrieved directory information.
To get the most accurate results, this command should be run at a time when there is very little activity for files in the specified directory. If SUBTREE(*ALL) is specified, try to run this command when there is very little activity for files in all subdirectories of the specified directory.
Note: If there is more than one member in the files, the results of running this command can be unpredictable.
|DIR||Directory||Path name||Required, Positional 1|
|SUBTREE||Directory subtree||*ALL, *NONE||Optional|
|INFFILEPFX||Information file prefix||Simple name, *GEN||Optional|
|INFLIB||Information library||Name, QUSRSYS||Optional|
Specifies the path name of the integrated file system object for which information will be collected.
For more information on specifying path names, refer to "Object naming rules" in the CL topic collection in the Programming category in the IBM i Information Center at http://www.ibm.com/systems/i/infocenter/.
This is a required parameter.
Specifies whether or not to collect directory information for subdirectories of the directory specified by the DIR parameter.
Specifies the file name prefix of the database files where the retrieved directory information is to be stored.
Specifies the library where the database files used to store the directory information will be created.
Example 1: Retrieve Information, Including Subdirectories
RTVDIRINF DIR('/MYDIR/MYDOCS') SUBTREE(*ALL) INFFILEPFX(*GEN) INFLIB(QUSRSYS)
This command retrieves directory information about directory /MYLIB/MYDOCS, including information for all nested subdirectories, and stores it the database files created in library QUSRSYS. The database files will be created with unique names that begin with 'QAEZD' followed by four digits. If this is the first time the RTVDIRINF command is run, the file names will be QAEZD0001O and QAEZD0001D.
Example 2: Retrieve Information for Specified Directory Only
RTVDIRINF DIR('/') SUBTREE(*NO) INFFILEPFX(MYROOTDIR) INFLIB(MYLIB)
This command retrieves directory information about the root directory without inspecting nested subdirectories and stores it in the database files MYROOTDIRO and MYROOTDIRD in library MYLIB. If database files with either of those names already exist in library MYLIB, an error message will be sent and no directory information will be retrieved.