Windows 2000 and Windows XP extended attributes
Windows 2000 and other newer Microsoft operating systems have three other file attributes that are used on NTFS partitions. These three attributes are often referred to as extended attributes:
- Compress: Used to enable on-the-fly file level compression of data
- Encrypt: Used to enables on-the-fly file level encryption of data
- Index: Used to allow files to be indexed by the OS Indexing Service.
The sections that follow take a closer look at each of these attributes.
The Compress attribute allows and restricts file compression. To compress a file or folder, follow these steps:
- Right-click the file or folder and choose Properties. The Properties dialog box appears.
- Click the Advanced button. The Advanced Attributes dialog box pops up.
- You will be able to compress the file or folder by selecting the Compress Contents to Save Disk Space check box.
To compress a file, then file needs to be read in to memory, where compression takes place, and then re-written to the disk is it's compressed form. When you change the compress file attribute, then the OS saves the change to attribute prior to actually going to steps of compression the file. This is done in two steps, since the attributes are stored in the MFT (Master File Table), and not in the actual file itself. After the attribute change is recorded, file compression for that file is performed. There is a small chance that something may go wrong during the compression phase, so that some of the files on your hard drive may have the Compress attribute set but may not actually be compressed. One situation that may cause this inconsistent Compress attribute is a power interruption during the compression process, so that the attribute change was made but the compressed version of the file was not saved. To ensure that this has not happened, you could use the command line utility, compact.exe.
compact.exe can be used to compress or decompress files from the command line. It supports switches that will allow it to process subdirectories as well. If you suspect inconsistent compression states for your files, you can use the /F or force switch, which goes through the process of compressing all files, even if they already have the compress attribute, this does not double compress files, but rather ensures that all files that are suppose the be compressed actually are compressed. See Table below for a complete list of the switches that compact.exe makes use of. If you run compact.exe without any switches, it will display compression information for the files in your current directory.
|/C||Compresses the specified files. Directories will be marked so that files added afterward will be compressed.|
|/U||Uncompresses the specified files. Directories will be marked so that files added afterward will not be compressed.|
|/S||Performs the specified operation on files in the given directory and all subdirectories. Default "dir" is the current directory.|
|/A||Displays files with the hidden or system attributes. These files are omitted by default.|
|/I||Continues performing the specified operation even after errors have occurred. By default, COMPACT stops when an error is encountered.|
|/F||Forces the compress operation on all specified files, even those which are already compressed. Already-compressed files are skipped by default.|
|/Q||Reports only the most essential information.|
In this tutorial:
- Managing Files and Directories
- Identifying File-Naming Conventions
- Long and short filenames
- Creating file associations
- Understanding file extensions
- Compression utilities Extensions
- Graphic files Extensions
- Understanding File Attributes
- The basic attributes
- Windows 2000 and Windows XP extended attributes
- Setting basic attributes