Extended Attributes

About Extended Attributes

Applications and the OS use Extended Attributes to provide information about a file or directory. Extended Attributes (EAs) may be used to store notes on file objects, categorize file objects, describe the format of data contained in the file object or append additional data to a file object. Extended attributes are supported in FAT and HPFS file systems and reside on the volume on which the file object is stored. For HPFS, the EA information is stored in the Directory entry. For FAT, the EA information is stored in a separate file (EA DATA. SF in the root directory), since there is not enough room in the directory. The file system manages the storage and maintenance of extended attributes.

Applications may create, query, and set EAs for any file object on a volume that supports EAs. There can be multiple EAs associated with a file object. Each EA can be up to 64KB in size. The sum of all EAs for a file is also limited to 64KB.

Extended attributes will be lost when an application that does not recognize EAs copies, moves or modifies a local file and when doing similar operations over a network or a COM device that does not recognize and support EAs. For this reason, do not use DOS applications to manipulate files containing EAs.

Extended Attribute Names

Each EA has two parts, a name and a value. Names are restricted to the same character set as file names.

In order for EA data to be understood by applications other than the one that created it, conventions have been established for naming EAs and indicating the type of data they contain. These Standard Extended Attributes (SEAs) are OS defined and allow various applications to access the text, bitmaps, icons and other binary data in these defined types of EAs. Standard Extended Attributes should be used when other applications will be accessing the same data.

Standard Extended Attributes have a dot (.) as a prefix for identification. Applications normally do not define special use extended attribute names that start with the dot character. Also, EAs that start with the characters $, @, &, or + are reserved for system use. Where entries for Standard EAs consist of ASCII characters, case is important.

The Standard Extended Attributes are:

The data type and use of these EAs are described in Standard Extended Attribute Values.

Other common EAs are:

These EAs all contain binary data and should never be modified unless attempting to fix the EA with an EA editor.

Applications are not limited to using SEAs to associate information with files. Applications can define their own specific EAs of any data type.

Extended Attribute Values

The value of an EA can be data of any type although the data types are generally either text, bitmap, icon or binary data. The OS does not check the data associated with an EA. The application that creates the EA and the applications that read them must recognize the format and meaning of the data associated with a given EA name.

Many EAs are of the single value type. In some cases, it is desirable for EAs to store more than a single piece of information or type of data. The multi-value formats provide that capability and specify how individual pieces of data are stored.

There are three multi-valued EA data types:

Multi-valued EAs can contain more than one multi-valued EA data type. The .ASSOCTABLE EA is an example of this type and can include several MVMT data values (examine the PICVIEW.EXE EAs for this type EA).

In order to allow EAs of different code pages, multi-valued EAs (for file objects only) include a field in which the EA's code page is specified. If this value is 0, the file default codepage is assumed. The multi-valued code page is used only by applications and is ignored by the OS. A directory EA code page is always default.

Standard Extended Attribute Values

The values of Standard Extended Attributes can be multi or single valued with formats following data type conventions.

From the user viewpoint, the .COMMENTS, .SUBJECT, .HISTORY and .KEYPHRASES EAs are safe and easy to use to add or modify comments, subject, history or search phrases for a file object.

Critical Extended Attributes

Extended Attributes associated with files may be marked as critical. Those associated with directories cannot be marked as critical. An EA should be marked as critical if its loss would cause the system or associated program to perform incorrectly. Extended attributes are normally non-critical. If a non-critical EA is lost, the associated application or system should continue to operate correctly. A file with a critical EA prevents a program that does not recognize EAs from losing the EAs from the file but does not prevent deletion of the file.

Extended Attributes are normally marked as critical by the application. A file has critical EAs if at least one EA attached to the file is marked as critical.

Applications that do not recognize EAs are not permitted to manipulate files that have critical EAs associated with them. This protection does not apply to directories. Applications that recognize EAs have no restrictions placed on their actions with respect to critical EAs.

The use of critical EAs is rare within the operating system. Some applications set critical EAs on every file within the application, a gross misuse of critical EAs.

Extended Attribute Support in FS/2 and FlexEdit

FS/2 supports viewing, creating and modifying most all type EAs, including complex multi-value, multi-type EAs, though the EA View dialog window and associated functions. Once the dialog window is displayed, click on any file object to view, create, delete or modify the associated EAs. FlexEdit has similar support for the loaded file, including the creation and support for the .CODEPAGE EA.


[Back: File Systems]     [Next: Product Information]