Display Attributes (DSPATR)
|Where allowed to run: All environments (*ALL)
The Display Attributes (DSPATR) command displays the attributes of a single object, all of the objects matching a specified pattern, or all of the objects in a specified subtree.
For more information about integrated file system commands, see the Integrated file system topic collection in the IBM i Information Center at http://www.ibm.com/systems/i/infocenter/.
Note: The authority requirements for this command are complex with respect to file systems, object types, requested operations etc.. Therefore, see the System i Security Reference, SC41-5302 book for information about the required authorities for this command.
|OBJ||Object||Path name||Required, Positional 1|
|OUTPUT||Output||Optional, Positional 2|
|SUBTREE||Directory subtree||*NONE, *ALL||Optional|
|SYMLNK||Symbolic link||*NO, *YES||Optional|
Specifies the path name of the object or a pattern to match the name of the objects to have their attributes displayed. The object path name can be either a simple name or a name that is qualified with the name of the directory in which the object is located. A pattern can be specified in the last part of the path name. An asterisk (*) matches any number of characters and a question mark (?) matches a single character. If the path name is qualified or contains a pattern, it must be enclosed in apostrophes. If a pattern is specified, more than one object matches the pattern, and the value of the Output (OUTPUT) parameter is not *PRINT, the user can select the object from a list in an interactive job. In a batch job, the command will fail with error message CPFA08E "More than one name matches pattern.".
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/.
Note: This parameter is Unicode-enabled. See "Unicode support in CL" in the CL topic collection in the Programming category in the IBM i Information Center at http://www.ibm.com/systems/i/infocenter/ for additional information.
This is a required parameter.
Specifies whether the output from the command is displayed at the requesting work station or printed with the job's spooled output.
- The output is displayed for interactive jobs or printed with the job's spooled output for non-interactive jobs.
- The output is printed with the job's spooled output.
Directory subtree (SUBTREE)
Specifies whether the attributes of the objects within the directory subtree are displayed if the object specified by the Object (OBJ) parameter is a directory.
- Display the attributes of the object specified by OBJ. If the object is a directory, its attributes are displayed, but the attributes of its contents are not displayed.
- Display the attributes of the object specified by OBJ. If the object is a directory, its attributes are displayed, as well as the attributes of its contents, subdirectories, and the contents of all of its subdirectories. If this value is specified, the value of the Output (OUTPUT) parameter must be *PRINT.
Note: Pattern matching on the OBJ parameter only applies to the first level objects. If the first level object is a directory, the pattern matching does not apply to its contents or the contents of its subdirectories.
Once the command has begun processing a specific directory subtree, the objects which will be found and processed may be affected by operations that update the organization of objects within the specified directory tree. This includes, but is not limited to, the following:
- Adding, removing, or renaming object links
- Mounting or unmounting file systems
- Updating the effective root directory for the process calling the command
- Updating the contents of a symbolic link
In order to process the directory subtree, the system code may increase the process-scoped maximum number of file descriptors that can be opened during processing. This is done so that the command is not likely to fail due to a lack of descriptors. This process-scoped maximum value is not reset when the command completes.
Symbolic link (SYMLNK)
If the last component in the path name is a symbolic link, specifies whether to display the attributes of the symbolic link or of the object pointed to by the symbolic link.
- The attributes of the symbolic link object are not displayed. The attributes of the object pointed to by the symbolic link are displayed.
- If the object is a symbolic link, the attributes of the symbolic link are displayed. The attributes of the object pointed to by the symbolic link are not displayed.
Example 1: Display Object Attributes
This command displays the attributes of object PAY located in directory X in the current directory.
Example 2: Display Object Attributes for Directory Subtree
DSPATR OBJ('/MYDIR') SUBTREE(*ALL) OUTPUT(*PRINT)
This command displays the attributes of object MYDIR located in the root (/) directory, all of the objects contained in directory MYDIR, and all the objects in its subdirectories. The attributes are printed to spooled output. Note that OUTPUT(*PRINT) is required when SUBTREE(*ALL) is specified.
- Error occurred during processing of command.
- Home directory not found for user &1.
- More than one name matches pattern.
- Not authorized to object. Object is &1.
- Path name too long.
- Object not found. Object is &1.
- Attributes displayed for &1 objects. &2 objects not displayed.