Extended attributes

An extended attribute is information associated with an object that provides additional details about the object. The extended attribute consists of a name, which is used to refer to it, and a value. The value can be text, binary data, or another type of data.

The extended attributes for an object exist only as long as the object exists.

Extended attributes come in many varieties and can be used to contain a variety of information. You may need to be aware of the following three extended attributes, in particular:

.SUBJECT
A brief description of the content or purpose of the object.
.TYPE
The type of data in the object. The type of data might be text, binary, source for a program, a compiled program, or other information.
.CODEPAGE
The code page to be used for the object. The code page used for the object is also used for the extended attribute associated with the object.

A period (.) as the first character of the name means that the extended attribute is a standard system extended attribute (SEA), which is reserved for system use.

Various objects in the various file systems may or may not have extended attributes. The QSYS.LIB and independent ASP QSYS.LIB file systems support three predefined extended attributes: .SUBJECT, .TYPE, and .CODEPAGE. In the document library services (QDLS) file system, folders and documents can have any kind of extended attribute. Some folders and documents may have extended attributes, and some may not. In the root (/), QOpenSys, and user-defined file systems, all directories, stream files, and symbolic links can have extended attributes of any kind. Some, however, may not have any extended attributes at all.

The Work with Object Links (WRKLNK) command and Display Object Links (DSPLNK) command can be used to display the .SUBJECT extended attribute for an object. There is no other integrated file system support through which applications or users can access and change extended attributes. The only exceptions to this rule are the Display a UDFS (DSPUDFS) and the Display Mounted File System Information (DSPMFSINF) CL commands, which present extended attributes to users.

Extended attributes associated with some objects in the QDLS can, however, be changed through interfaces provided by the hierarchical file system (HFS).

If a client PC is connected to a IBM i platform through the Windows operating systems, the programming interfaces of the respective operating system (such as DosQueryFileInfo and DosSetFileInfo) can be used to query and set the extended attributes of any file object.

If you define extended attributes, use the following naming guidelines:

  • The name of an extended attribute can be up to 255 characters long.
  • Do not use a period (.) as the first character of the name. An extended attribute whose name begins with a period is interpreted as a standard system extended attribute.
  • To minimize the possibility of name conflicts, use a consistent naming structure for extended attributes. The following form is recommended:
        CompanyNameProductName.Attribute_Name