Compressing a Folder in NTFS5
Windows XP supports more file systems than any other Microsoft operating system, and each file system has its own set of features and foibles. Choosing the appropriate file system for a given situation is an important part of using Windows XP successfully, and it’s also an important part of the certification exam.
Compression is one of the new goodies Microsoft built into NTFS Version 5. This is a very likely subject for exam questions!
Compression enables you to reduce the amount of space on disk that a file or folder occupies. NTFS compression is transparent; that is, after you’ve designated a file as compressed, you don’t need to expand it manually before you can use it again. NTFS automatically handles that, as well as the recompression after you’ve edited and saved the file. Any Windows or DOS program that can run under Windows XP can work with compressed files. If you designate a folder as being compressed, then when you create a new file inside that folder or copy an existing file into that folder, NTFS automatically compresses the file.
The compression technology built into NTFS 5 is more sophisticated than that available in earlier Windows operating systems. With NTFS compression, you can specify a drive, a folder, or a file within a folder. With Windows 98 and DoubleSpace compression, you had to specify an entire drive to be compressed.
Setting compression on files or folders
Compressing a file or folder is simple:
1. Log on as an administrator to the local PC.
You must have Write permission for any file or folder that you want to compress.
2. Right-click the My Computer icon on the desktop or Start menu, and choose Explore.
3. Expand the tree in the left window pane to display (for example) the C:Program FilesNetMeeting folder.
If your Windows XP system uses a different drive letter, substitute it for C.
4. Right-click the NetMeeting folder in the left window pane and choose Properties.
5. Click the Advanced button in the Accessories Properties dialog box.
You should see the Advanced Attributes dialog box.
6. Click the box labeled Compress Contents to Save Disk Space.
Note that you can’t select this option simultaneously with the check box that says Encrypt Contents to Secure Data. (Go ahead and try.)
7. Click OK and then click OK again (to close two dialog boxes).
8. In the Confirm Attribute Changes dialog box, check the box labeled Apply Changes to This Folder, Subfolders, and Files.
This action means that Windows XP will compress everything inside the NetMeeting folder. If you check the other box, then you designate the folder as being compressed without designating any of its contents as being compressed. That’s perfectly legal, and if you did so, from that point forward, any file that you copy into the NetMeeting folder is automatically compressed.
Note also that you get this same option when you “uncompress” a folder.
9. Click OK.
The NetMeeting folder and its contents are now compressed.
Viewing compressed files and folders
Most of us find it handy to have a visual cue to indicate whether a given file or folder is compressed. Windows XP gives you the option to specify that you’d like the user interface to show compressed files and folders in a different color than uncompressed ones. The following steps take you through the simple procedure, again assuming that your C drive uses NTFS.
1. Choose Start –> Control Panel and double-click Folder Options.
2. Click the View tab.
3. Check the box that says Show Encrypted or Compressed NTFS Files In Color.
4. Click OK.
Now, glance at C:WINDOWSSYSTEM32DLLCACHE. It should appear in an alternate color, indicating (in this case) that the folder’s contents are compressed.
Copying and moving
What happens to a compressed file when you copy or move it? The rules aren’t intuitively obvious, and they make perfect fodder for exam designers. So here we go, easier rules first:
- Copying or moving a compressed file to a FAT disk or to a diskette: The file is uncompressed in its new location.
- This makes sense when you remember that compression is an NTFS-only feature.
- Copying or moving a compressed file from one NTFS volume to another: The file inherits the compression status of the destination folder.
- Copying a compressed file within an NTFS volume: The file inherits the compression status of the destination folder.
- Moving a compressed file or folder within an NTFS volume: The file or folder keeps its compression status, regardless of the status of the destination folder.
Here are a few tips to remember:
- Don’t compress if you don’t need it. Even if you need it, consider alternatives (such as adding a hard drive). Compression may be transparent after you’ve set it up, but it does incur some system overhead.
- Don’t compress files with formats that tend to be space efficient to begin with, such as JPG, GIF, ZIP, DLL, and EXE files. You don’t realize any appreciable space savings and you increase system overhead.
- Don’t compress volatile files that change often (again, because of system overhead). For example, compression is generally a bad idea for active database files.