I just got done re-installing OS-X (an old Microsoft habit, I guess), and was installing XCode when I realized that almost half of the installation size of XCode is the documentation. I need that documentation, but hate to see 1.3 Gb of my hard drive gobbled up by something that is:
$ cd /Developer
$ sudo hdiutil create -srcfolder "ADC Reference Library"
-format UDBZ DevLibrary.dmg
That will build the compressed reference library in the Developer folder. Once you are done, delete the "old" reference folder, and make an empty placeholder for later:
$ sudo rm -rf "ADC Reference Library"
$ mkdir "ADC Reference Library"
Note: I didn't sudo the mkdir command on purpose, to keep the following Folder Action from prompting me for a password just to open the Developer documentation.
Now once you're done, you can attach to it using hdiutil:
$ hdiutil attach -mountpoint /Developer/ADC Reference Library
/Developer/DevLibrary.dmg
That's it! It's not a read/write volume, but that doesn't seem to be a problem. Be patient while it checksums the file on the first mount, it will go faster once everything checks out.
on opening folder this_folder
tell application "System Events"
if file "/Developer/ADC Reference Library/index.html" exists then
-- display dialog "it exists!" --used for testing
else
do shell script "hdiutil attach -mountpoint /Developer/ADC\ Reference\ Library/ /Developer/DevLibrary.dmg"
end if
end tell
end opening folderMac OS X Hints
http://hints.macworld.com/article.php?story=20070502043036544