<p>Attributes are data fields that belong to a file but aren't part of that file, e.g. they are not computed into the file size and can be copied or changed without touching the file itself. The system uses these attributes to store e.g. file size, file type or date of the last modification. This is similar to other operating systems and their filesystems.</p>
<p>What's different is that you can add any kind of attribute to any file and display it or make it editable in a Tracker window. You just have to define the kind of attribute you want to add to a file type (e.g. string, integer or time) and give it a name and description.</p>
<p>The file itself doesn't even need any contents at all. Take a look at these People files for example:</p>
<p>Attributes are displayed quite similar to a database or spreadsheet. Using Tracker you can choose which attributes to display (columns) and sort file listings (rows) accordingly.</p>
<p>To do this, open a Tracker window, click on the <spanclass="menu">Attributes</span> menu, and select the attributes you want to display. Alternatively, simply right-click onto a column heading and mark the items in the context menu. You can rearrange the columns by a simple drag&drop of the column heading. Moving a column out of a window, is a fast way to get rid of columns you don't need.</p>
<p>Click on a column heading to toggle the sorting order from ascending to descending. You can establish a secondary sort order by pressing the <spanclass="key">SHIFT</span> key while clicking on a column heading. Doing that you can, for example, sort your People files by company and within that order sort by contact name. See the above screenshot as an example. The secondary sort order is marked by a dotted line under the heading.</p>
<p>Editing these attributes is as simple as renaming a file: Either click on an entry or press <spanclass="key">ALT</span> <spanclass="key">E</span> and move between the attributes with <spanclass="key">TAB</span> and <spanclass="key">SHIFT</span> <spanclass="key">TAB</span>. <spanclass="key">ESC</span> leaves the editing mode without applying the changes.</p>
<p>If you prefer to use the commandline or plan to work with many files using scripting, there are several commands for controlling attributes from Terminal:</p>
<ul><li><b>listattr</b> - lists a file's attributes, but doesn't show the contents of the attributes.<br/>
<p>Besides all the "<tt>META:*</tt>" attributes that hold the contact's information, there are two attributes that are managed by the system:</p>
<ul>
<li><p><tt>BEOS:TYPE</tt> holds the file type as a <acronymtitle="Multipurpose Internet Mail Extensions">MIME</acronym> string, here "<tt>application/x-person</tt>. It determines the default icon and the application that opens the file when you e.g. double click it.</p></li>
<li><p>"<tt>_trk/pinfo_le</tt>" is the attribute with which Tracker keeps track of a file's icon position.</p></li></ul>
<divclass="box-info">Note the backslash after "Clara". In Terminal you have to "escape" special characters like <tt>'"*\$?!</tt>. The space between "Clara" and "Botters" is also one of those. Therefore the backslash is really in front of the space character, and not after "Clara".</div></li>
<p>So, say dear Clara took a job with the multi-national Barkelbaer Inc., you fill the formerly empty "Company" attribute with that data (which is of type "string"):</p>
<preclass="terminal"> ~/people ->addattr -t string META:company Barkelbaer\ Inc. Clara\ Botters</pre></li>
</ul>
<p><br/></p>
<ul><li><b>rmattr</b> - completely removes an attribute from a file.
If you do want to copy the attributes plus the data of the file itself, you can add the option "<spanclass="cli">-d</span>" or "<spanclass="cli">--data</span>".</li>
<p>More information on these commands and their options can be found by typing the command name followed by "<spanclass="cli">-h</span>" or "<spanclass="cli">--help</span>".</p>