Compression: How It Works, How to Use It


Windows XP ships with built-in provisions for file compression that is implemented via NTFS. It's not strictly true that only NTFS files and folders can be compressed, because a command-line program called compress can compress FAT-based files and folders. However, you must, in turn, use the expand command to decompress the resulting files and folders before you can use them. This procedure is awkward. So, for practical purposes, compression is implemented seamlessly into the operating system only on NTFS-formatted volumes.

File compression works by encoding data to take up less storage space. Digital data is compressed by finding repeatable patterns of binary 0s and 1s. The more patterns found, the more the data can be compressed. Text can generally be compressed to about 40 percent of its original size and graphics files from 20 to 90 percent. Some files (namely .EXE files) compress very little because of the lack of repeating data patterns within the program. The amount of compression depends entirely on the type of file and compression algorithm used.

Compressing a file or folder in Windows is a simple and straightforward process:

1.

Open Windows Explorer, and select the file or folder you want.

2.

Right-click, and select Properties from the context menu.

3.

Select the Advanced button at the bottom of the Properties dialog.

4.

In the Advanced Attributes dialog that appears, put a check mark in front of the Compress Contents to Save Disk Space option (refer to Figure 29.8).

5.

When you click OK, you are prompted to choose whether you want to compress files and folders, if you're compressing a folder, recursively. Doing so is generally desirable and a safe bet.

Two caveats are in order with compression:

  • A file or folder can be compressed or encrypted, but not both. These options are mutually exclusive.

  • By default, compressed files are shown in blue, while encrypted files are shown in green. If you choose Control Panel, Folder Options and select the View tab, you can find an option to display compressed and encrypted files or folders in an alternate color.

CAUTION

You should keep in mind some disk space requirements when using compression. If you try to compress a volume that's running extremely low on free space, you might see this error message:

 Compression Error File Manager/Explorer cannot change compress attributes for: "path\filename" 

These error messages indicate that the system needs additional free space to perform compression. The system is not designed to manipulate the data in place on the disk. Additional space is needed to buffer the user data and to possibly hold additional file system metadata. The amount of additional free space required depends on the cluster size, file size, and available space.


Use compression only when expressly needed. Compression will cause significant performance reduction if a significant number of commonly accessed files are compressed, due to the CPU processing required to decompress them for use.



Special Edition Using Microsoft Windows XP Professional
Special Edition Using Microsoft Windows XP Professional (3rd Edition)
ISBN: 0789732807
EAN: 2147483647
Year: 2003
Pages: 450

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net