15.2 Compressing Files and Folders


Although the hard drives made these days have greater capacities than ever, programs and files are much bigger, too. Running out of disk space is still a common problem. Fortunately, Windows XP Pro is especially effective at compressing files and folders to take up less disk space.

POWER USERS' CLINIC
Creating a New Spanned Volume

The flexibility of dynamic disks never ends. If you find yourself with bits of unallocated space on two or more dynamic disks, you can actually sweep these scraps together into a single new volume ”a spanned volume ”that behaves, in Windows, as though it's a single "hard drive."


figs/15inf02.gif

To do this, start in the Disk Management window (Figure 15-2). Right-click any unallocated space on any of the disks and select New Volume from the shortcut menu. On the Select Volume Type screen, click the Spanned option. On the Select Disks screen, the unallocated space you clicked appears in the Selected column, and any unallocated space on other dynamic disks appears in the Available column, which is shown here.


Compressing files and folders can also be useful when you want to email files to someone without dooming them to an all-night modem-watching session. That's why Microsoft has endowed Windows XP with two different schemes for compressing files and folders: NTFS compression for storing files on your hard drive, and zipped folders for files that might have to be transferred.

15.2.1 NTFS Compression

If Windows XP Pro was installed on your PC when you bought it, or if you upgraded your PC from Windows 2000, or if you erased your hard drive before installing Windows XP, then your hard drive is probably formatted using a file system called NTFS (short for NT file system; see Section A.4 for details).

Most people can live a long and happy life without knowing anything about NTFS. If you work in a corporation, you might be grateful for the additional security it offers to Windows XP Pro fans (Chapter 17), and leave it at that. Now and then, however, you'll read about other features that are available only if your hard drive was prepared using NTFS ”and this is one of those cases.

NOTE

To find out whether or not your hard drive uses NTFS formatting, choose Start My Computer. Right-click the hard drive icon; choose Properties from the shortcut menu. In the resulting dialog box, you'll see either "File system: NTFS" or "File system: FAT 32." (If it says FAT 32, you probably upgraded your PC from Windows 98 or Windows Me.) Unfortunately, special NTFS features like automatic compression aren't available to you, but you can upgrade your drive formatting to NTFS without having to erase it. See Section A.4 for instructions.

The NTFS compression scheme is especially likable because it's completely invisible to you. Windows XP Pro automatically compresses and decompresses your files, almost instantaneously. At some point, you may even forget you've turned it on. Consider:

UP TO SPEED
Data Compression

Data compression is the process of replacing repetitive material in a file with shorthand symbols. For example, if a speech you've written contains the phrase going forward 21 times, a compression scheme like the one in NTFS may replace each occurrence with a single symbol, making the file that much smaller. When you reopen the file later, the operating system almost instantaneously restores the original, expanded material.

The degree to which a file can be compressed depends on what kind of data the file contains and whether it's already been compressed by another program. For example, programs (executable files) often shrink by half when compressed. Bitmapped graphics like TIFF files squish down to as little as one-seventh their original size, saving a great deal more space.

The GIF and JPEG graphics files so popular on the Web, however, are already compressed (which is why they're so popular ”they take relatively little time to download), and so they don't get much smaller if you try to compress them manually. That's one of the main rules of data compression: data can only be compressed once.

In short, there's no way to predict just how much disk space you'll save by using NTFS compression on your drives. It all depends on what you have stored there.


  • Whenever you open a compressed file, Windows quickly and invisibly expands it to its original form so that you can read or edit it. When you close the file again, Windows instantly recompresses it.

  • If you send compressed files (via disk or email, for example) to a PC whose hard drive doesn't use NTFS compression, Windows XP once again decompresses them, quickly and invisibly.

  • Any file you copy into a compressed folder or disk is compressed automatically. (If you only move it into such a folder from elsewhere on the disk, however, it stays compressed or uncompressed ”whichever it was originally.)

15.2.1.1 Compressing files, folders, or disks

To turn on NTFS compression, right-click the icon for the file, folder, or disk whose contents you want to shrink. Choose Properties from the shortcut menu. Click the Advanced button, and in the resulting dialog box, turn on "Compress contents to save disk space" (Figure 15-9). If you have selected a folder for compression, you are prompted as to whether you also want to compress the files and subfolders within it.

Figure 15-9. If you don't see the "Compress contents to save disk space" checkbox (highlighted here), then your hard drive probably doesn't use the NTFS formatting scheme.
figs/15fig09.gif

Many Windows veterans wind up turning on compression for the entire hard drive. It can take Windows XP several hours to perform the initial compression of every file on the drive. (If you plan to go see a movie while Windows is working, though, quit all your programs first. Otherwise, the compression process will halt whenever it encounters an open file ”waiting for you to close the file or tell Windows to ignore it ”and you'll find the job only half done when you return.)

When Windows is finished compressing, the compressed file and folder icons appear in a different color, a reminder that Windows is doing its part to maximize your disk space. (If they don't change color, somebody ”maybe you ”must have turned off the "Show encrypted or compressed NTFS files in color " option described in Section 3.2.4.)

When you look at the Properties dialog box for a compressed file (right-click the file and choose Properties from the shortcut menu), you can see two file sizes. The Size value indicates the actual (uncompressed) size of the file, and the Size On Disk value is the compressed size of the file, that is, the amount of disk space it is occupying.

15.2.2 Zipped Folders

As noted above, NTFS compression is great for freeing up disk space while you're working at your PC. But when you email your files to somebody else or burn them to a CD, Windows XP always decompresses them right back to their original sizes first. And, of course, NTFS compression isn't even an option if your hard drive doesn't use NTFS formatting (Section A.4).

Fortunately, there's another way to compress files: Zip them. If you've ever used Windows before, you've probably encountered Zip files. Each one is a tiny little suitcase, an archive, whose contents have been tightly compressed to keep files together, to save space, and to transfer them online faster (see Figure 15-10). Use Zip files when you want to email something to someone, or when you want to pack up a completed project and remove it from your hard drive to free up space.

Figure 15-10. Top: A Zip archive looks like an ordinary folder ”except for the tiny zipper . Bottom: Double-click one to open its window and see what's inside. Notice (in the Ratio column) that JPEG graphics and GIF graphics usually don't become much smaller than they were before zipping, since they're already compressed formats. But word processing files, program files, and other file types reveal quite a bit of shrinkage .
figs/15fig10.gif
15.2.2.1 Creating zipped folders

In Windows XP, you don't even need a shareware program like PKZip or WinZip to create or open Zip files. You can create a Zip archive in either of two ways:

  • Right-click any blank spot on the desktop or an open window. From the shortcut menu, choose New Compressed (zipped) Folder. Type a name for your newly created, empty archive, and then press Enter.

    Now, each time you drag a file or folder onto the archive's icon (or into its open window), Windows automatically stuffs a copy of it inside.

    Of course, you haven't actually saved any disk space, since now you have two copies of the original material (one zipped, one untouched). If you'd rather move a file or folder into the archive ”in the process deleting the full-size version and saving disk space ”right-drag the file or folder icon onto the archive icon. Now from the shortcut menu, choose Move Here.

  • To turn an existing file or folder into a zipped archive, right-click its icon. (To zip up a handful of icons, select them first, then right-click any one of them.) Now, from the shortcut menu, choose Send To Compressed (zipped) Folder. You've just created a new archive folder and copied the files or folders into it.

NOTE

At this point, you can right-click the zipped folder's icon and choose Send To Mail Recipient. Windows automatically whips open your email program, creates an outgoing message ready for you to address, and attaches the zipped file to it ”which is now set for transport.

15.2.2.2 Working with zipped folders

In many respects, a zipped folder behaves just like any ordinary folder. Double-click it to see what's inside.

If you double-click one of the files you find inside, however, Windows opens up a read-only copy of it ”that is, a copy you can view, but not edit. To make changes to a read-only copy, you must use the File Save As command and save it somewhere else on your hard drive.

NOTE

Be sure to navigate to the desktop or the My Documents folder, for example, before you save your edited document. Otherwise, Windows will save it into an invisible temporary folder, where you may never see it again.

HISTORY CLASS
PKZip

The Zip archive format was developed in the late 1980s by Phil Katz, a pioneer of PC compression technology. Katz's original product, PKZip, was a DOS-based archiving program that soon became an industry standard.

There have been many other archive compression standards over the years , but none of them became as ubiquitous as the Zip format. Every program today that creates or manipulates Zip files, including Windows XP, owes a debt of thanks ”if not a free T-shirt or two ”to Phil Katz.


To decompress only some of the icons in a zipped folder, just drag them out of the archive window; they instantly spring back to their original sizes. Or, to decompress the entire archive, right-click its icon and choose Extract All from the shortcut menu (or, if its window is already open, click the "Extract all files" link on the task pane). A wizard asks you to specify where you want the resulting files to wind up.



Windows XP Pro. The Missing Manual
Windows XP Pro: The Missing Manual
ISBN: 0596008988
EAN: 2147483647
Year: 2003
Pages: 230

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