A+ Certification / Beginners

Understanding File Attributes

Since the first versions of MS-DOS and the FAT file system, files have had some basic attributes. The following sections deal with only the attributes that a user of a computer will manage, which are Read-only, Hidden, System, and Archive. The discussion focuses on the basic attributes, the extended attributes offered by Windows 2000 and Windows XP NTFS, and how to change the file attributes.

Working with the Volume Label

In addition to these four basic attributes, one more attribute, Volume, is usually set on your hard drive. The Volume attribute is usually applied to only one directory entry per drive (excluding the directory entries that are used for long filename entries) and stores the volume label for the drive. The directory entry that contains the label can be modified through one of the following methods:

  • By using the label command at a command prompt
  • By editing the Label field in the Properties window of your drive
  • By using the Rename command in the My Computer window (Windows 2000 and Windows XP only)

How attributes are stored

Attributes are stored as a single 8-bit binary number. Because each bit can hold either a 0 or 1, this yields 256 possible combinations of attributes - from eight 0s (no attributes applied; equal to 0 in decimal notation) to eight 1s (all attributes applied; equal to 255 in decimal notation).

Because each attribute holds a specific bit position, if several attributes are applied to a file, you can add the values (either binary or decimal) together to get a unique number that is 255 (11111111 in binary) or less for each unique combination of attributes. For example, if the file had the attributes of Read-only (1), System (4), and Archive (32), then the value of the attribute byte would be 1 + 4 + 32, or 37. Only 37 (00100101 in binary) could represent a file with these attributes. The full list of attributes is listed in Table below.

File Attributes
Bit positionDecimal ValueBinary ValueAttribute
1100000001Read-only
2200000010Hidden
3400000100System
4800001000Volume Label
51600010000Subdirectory
63200100000Archive
76401000000Unused
812810000000Unused
[Previous] [Contents] [Next]