Extended Attributes are a method which OS/2 uses to store information about a file without modifying the contents of the file. The information is not stored within the file itself. This applies equally to directories.
The file system itself stores this information. On a FAT partition the data is stored in a file called "EA DATA . SF". This is normally a hidden, system file in the root directory. A HPFS partition stores the data in a different manner. The HPFS file system has separate structures within the file system which allow for the storage of extended attribute data to be separate and distinct from the file data. To a program there is no difference in how this data is manipulated, and the data itself is identical.
The DIR command on a FAT partition will report something similar to:
The volume label in drive C is SYSTEM DISK. The Volume Serial Number is 3A1F:1BEB Directory of C:\With the DIR command on any other type of partition (HPFS, LAN, CD-ROM etc) you will notice that you get an extra column of numbers. This extra column is the size of the Extended Attributes associated with that file or directory.IO SYS 33430 9-04-91 5:00 MSDOS SYS 37394 9-04-91 5:00 OS2 <DIR> 28-07-93 20:45 EA DATA SF 940032 28-07-93 20:47 WP ROOT SF 224 3-01-94 20:09 STARTUP CMD 118 3-01-94 19:24
The volume label in drive E is DEVELOPMENT. The Volume Serial Number is A608:DC15 Directory of E:\It can be seen from the above that the directory OS2UTILS has 10,858 bytes of extended attributes associated with it.21-12-93 20:38 DIR 0 . 21-12-93 20:38 DIR 0 .. 10-01-93 0:48 37754 0 ALLFILES.LST 23-12-92 21:15 234402 0 OLVR11G.LZH 6-01-94 0:00 DIR 10858 OS2UTILS
The size of extended attributes can be displayed on FAT partitions by using the DIR /N command.
Each extended attribute has two parts - a name and data. The name is just a string and the data can be anything. There is a limit of 64K of extended attribute data per file. There is no limit to the number of extended attributes per file - so long as the 64K restriction is observed.
There are some predefined types of extended attributes, although applications may define and use their own. The predefined attributes are listed below:
There are also some standard extended attribute names which are in common use. Although they all use a .Name format, this is not a requirement for extended attributes.
OS/2 itself, as well as other applications, use extended attributes. For example, OS/2 uses extended attributes to display icons, for example. The extended attribute name is .ICON and the type is EAT_ICON.
In addition, applications such as FI use extended attributes to save the information about a file without modifying the file itself. FI uses the .COMMENTS extended attribute of type EAT_ASCII to save its information.
If the .LONGNAME extended attribute is present, the OS/2 File Manager will use it to display the name of the file.