IZip is a free powerful archiving utility designed specifically for Mac. Easily manage ZIP and RAR files directly from the OS X Finder. Open and securely share ZIP.
Snow Leopard introduces a new feature that has been used on most of the system files: HFS+ compression. This compression is rather different than most other file compression options available in the sense that it is completely transparent; there isn't even a way to tell that the files are compressed using Snow Leopard's included command line tools (in fact, contrary to what some posts on this site have suggested, command line utilities like strings will see the same file regardless if it is compressed or not). In order to even determine if a file is compressed using HFS+ compression or not, a tool like is needed. As an example, here's part of the hfsdebug output for the QuickTime X executable.
$ sudo hfsdebug /Applications/QuickTime Player.app/Contents/MacOS/QuickTime Player. # Resource Fork logicalSize = 6618026 bytes totalBlocks = 1616 fork temperature = no HFC record in B-Tree clumpSize = 999 extents = startBlock blockCount% of file 0x21f625 0x650 100.00% 1616 allocation blocks in 1 extents total. 1616.00 allocation blocks per extent on an average.
The first thing that I tried to do was figure out the system call used for compression; ditto uses the private framework Bom to compress files. However, looking into it further I found that the Bom framework makes a call to another private framework: AppleFSCompression. Unfortunately the syntax for the functions in AppleFSCompression is far from obvious, especially since it is a private framework which means that there are no included headers for it (and it also means that it will probably remain closed source). It didn't in the end matter however, because I found that zlib is used for the actual compression and that library is well documented. So I decided to simply figure out how the HFS+ compressed files are constructed and added that to my program.
Here's how the HFS+ compression is applied: 1. Check the file to ensure it does not have a resource fork or com.apple.decmpfs extended attribute. Construct the headers, calculate the number of 64 KiB blocks needed based on the source file size. Compress the 64 KiB blocks using zlib (Apple uses compression level 5, but other compression levels also work); if there is only one block then append it to the com.apple.decmpfs extended attribute if the compressed data is 3786 bytes or less in size, otherwise the compressed data is put into the resource fork of the file. If the resource fork is used to store the compressed data, then no block is allowed to be larger after compression (if a block is larger after compression then compression for the entire file will fail). After the compressed blocks are created then their locations and sizes are written to the resource fork data header. Add the com.apple.decmpfs extended attribute to the file, then the resource fork if one is needed.
Truncate the data fork length to zero and use chflags to set the HFS+ compression flag. This produces compressed files that are identical to the ones produced by ditto, provided compression level 5 was used for the zlib functions. Yes I could have worded that better. After I submitted this hint I found that there are some obscure ways to tell if a file is compressed.
For example, if stat -f%f file returns a number that has the 32 flag set (the UFCOMPRESSED flag) then the file is HFS+ compressed. I can't say I can see how more or less can be used to identify compressed files though, as the data being printed to the screen is the uncompressed data, not the compressed (just tried it, you may have somehow gotten a different result but I tried it on some compressed files and it is definitely showing the uncompressed data).
Less certainly works differently than cat, but Apple would have to specifically modify it to not use standard POSIX calls.; search for 'fdopen' to see where it's opening its input file. Less is a surprisingly complex utility but it still uses a standard POSIX function to open a regular file, search for open(qopenfilename, OPENREAD) within the file to find it. Man 3 fdopen 2 open will confirm that both of these system calls are standard POSIX calls, so they don't really know anything about HFS vs. Any other file system. (Also, 'more' is simply the compatibility mode of 'less.' They're the same file, hard linked.).
Wow, I just saved several gigabytes by compressing a few big apps (just using 'sudo ditto -hfsCompression'), I can't tell the difference except for the free space I gained! For example Photoshop still takes the same amount of time to launch after a cold reboot (even slightly quicker, if anything), does not complain about damaged files, I was afraid it might give me some DRM-like nastiness with moved/changed files, but no, everything just works like before, only taking a few hundreds of MB less! Next up is the Application support folder:-). The script is easy: on adding folder items to thisFolder after receiving theseItems set destinationPath to '/POSIX path/to/destination/folder' repeat with thisItem in theseItems set cmd to 'ditto -hfsCompression ' & quoted form of POSIX path of thisItem & ' ' & destinationPath do shell script cmd with administrator privileges end repeatend adding folder items tothe 'with administrator privileges' part is unnecessary (and annoying) if you're compressing files you have ownership of.
It authenticates you whether it needs to or not. That attitude probably creates more security holes than all technical errors put together. Security is not an absolute matter, nor does it have the same requirements everywhere.
Insisting on following rigid little rules like this creates annoyances and inconviences that people then respond to by circumventing the security mechanism entierly, e.g., telling anyone who sits down at the machine their password so they can run secure processes, chowing all the files to their own user, etc. For instance on my laptop I add myself to the wheel group and let the wheel group use sudo without a password.
Would I do this on a corporate machine or webserver? But does that make it a security risk on my laptop? The point of security on my laptop is to protect my private documents and files. If they already have access to my user account the game is over. This HFS+ compression thread is the first clue to a problem I have.
After a boot failure the local apple store did an archive and install. The OS was set up for multiple users with one admin. The admin account data is fine but all the other users data is invisible with a.BC file prefix on all the user data files. The current OS is 10.5.8. Could they have used 10.6 initially and compressed the users files? All system files are OK.
Is there a way to restore the 190 GB of now invisible and unreadable files? In terminal mode they all show up with a ls -l command but the filenames are coded. The only solution the apple store offers is a wipe and install. There's a menu bar add-on called which does HFS compression on folders in the background.
But Squeeze won't compress anything in the /Developer folder. To get around this limitation and save some space in /Developer paste the following shell script into a file called dev-compress.sh. #!/bin/bash## dev-compress.sh# HFS compress most of /Developer#cd /Developer# cd /Xcode4;# for xcode 4 betafor DIR in Applications Documentation Examples Extras Library Platforms SDKs usrdo echo Compressing $DIR. Mv $DIR $DIR.orig ditto -hfsCompression $DIR.orig $DIR rm -rf $DIR.origdone. Then prep and execute. Chmod ug+x dev-compress.shsudo dev-compress.shAfter a few months I have seen no adverse effects on using XCode 3 or XCode 4 with these folders compressed.
How to Zip and Unzip Files on Your Mac Files you download from the Internet are often compressed or zipped so that they take up less space and arrive much faster than files that haven’t been compressed. You can easily identify compressed files by their extensions, such as.zip (a common standard used in OS X and Windows) and.sit. Before you can use these files, you must learn how to unzip files on mac computers for proper access – luckily the process isn’t that complicated! How to unzip files on mac computers Unzipping a file on a mac computer is user-friendly and intuitive. To unzip files on a mac, simply follow the steps below:.
Double click the zipped file. The file will automatically be decompressed by Archive Utility into the same folder the compressed file is in. Access the extracted files by clicking the appropriate icons. Alternatively, if the method above does not work, you can right-click on the.zip package, and select Open With Archive Utility (default). Apple and third party software Apple used to include a program called StuffIt Expander to decompress zipped files, but doesn’t now that OS X lets you unzip files (but not.sit files). However, StuffIt from SmithMicro Software still comes in handy for opening other types of compressed files, notably the.sit or.sitx compressed types. Go to or to download a free version of the software or to splurge for the Deluxe version.
In addition to compressing files, StuffIt Deluxe lets you encrypt and back up files. Meanwhile, you can archive or create your own.zip files through OS X, which is useful if you’re e-mailing a number of meaty files to a friend. Right-click (or Ctrl-click) files you want to compress inside Finder and choose Compress Filename. The newly compressed files carry the.zip extension. The archive is created in the same location as the original file and is named originalfilename.zip. You can also choose File→Compress.
If you compress a lot of files at once, the archive takes the name Archive.zip. By default, compressed files are opened with the Archive Utility. It appears in the Dock (in Leopard) while the files are being unsqueezed, unless you choose to open them with Stuffit Expander or some other program. How to zip files on a mac On the flip side, you can also archive or create your own.zip files through OS X, which is useful if you’re e-mailing a number of meaty files to a client or friend. Follow the step-by-step instructions below to easily zip files on a mac:. Right-click or Ctrl-click the multiple files you want to compress (whether on the desktop or inside the Finder).
Select Compress Filename from the pop-up menu. The files are now compressed in a.zip extension and the archive is created in the same location as the original file name, except with the.zip appended to its name. On some Apple computers, you can also compress a file by simply choosing File→Compress.
If you compress a lot of files at once, the archive takes the name Archive.zip.