In OS X, the Finder comes with a handy archiving option (called "Archive" in OS X prior to Leopard, and "Compress" 10.5 and above) that is available in the contextual menus as well as in the File menu. This feature will compress all selected files and folders into a ZIP archive for easy transfer to hard disks, network shares, or internet folders. In Snow Leopard, some people have had problems with the archive process, where it will pause indefinitely and fail to complete the compression.
For most affected users, this problem will happen toward the end of the compression, when the system claims there are only a few seconds remaining in the process. While it will occur on the OS X boot drive and other local file systems, it seems to happen more frequently on files and folders that were transferred between different file systems, especially FAT and networked file systems.
This problem happens because the system is having trouble managing the dot-underscore files (i.e, "._filename") that are present in the folder being compressed. For some reason the zip compression routine used for Apple's Archive feature may hang when encountering these files.
The dot-underscore files are the resource forks that were part of the file structure on HFS volumes before OS X. While OS X will still handle forked file support on HFS disks, many file systems and file sharing services will not (i.e., SMB shares, UFS volumes, and NFS shares). When forked files are copied to these disks, they will be split by Apple's Apple Double mechanism so the resource fork is preserved instead of being discarded by other file systems. The Apple Double process creates the dot-underscore file that contains the resource fork contents of the original file.
The resource fork for files is usually minimal and contains no important data, so for the most part you will not lose any data if you just delete them; however, the safest way to manage them is to merge them back with the original file. If the folder being compressed only has a few dot-underscore files, you can just remove the files, especially if they are minimal in size (4KB or less); however, merging them may be just as easy, which can be done by using the "dot_clean" terminal command.
This can be done by first ensuring the volume is formatted to HFS (Mac OS, or Mac OS Extended), which will ensure that the file system supports forked files, and then use the dot_clean command in the Terminal with the following procedure:
- Open the Terminal
- Type "dot_clean", followed by a single space
- Drag the folder containing dot-underscore files to the terminal window
- Press enter
Once the dot_clean command has been run on the folder, try compressing the desired files and folders again.