Amazed ? Don't be. Those who do such things make "optimized" CD images (or ISO files). This article explains how they do it.
Basically, this is how an "optimized" ISO image of a CD works:
1. Any CD (or ISO image) has something called a TOC (the Table of Contents of the files on the CD).
2. All files are written to the CD and a corresponding entry to that file is made in the TOC (which tells your CD drive where to find that file).
3. Normally for any file or folder, there's one entry in the TOC. The exact file if put in another folder will acquire another entry in the TOC in addition to being written in the CD's "contents" area.
4. Look at the graphic in the attachment below. In it, assume the similar geometrical shapes to be identical files. Now, if the black circle was a file 100 MB in size, writing it to a CD in 3 separate places would cost you 300 MB. And, if each saffron square was 25 MB, 2 squares would have amounted to 50 MB. Let's say the irregular yellow shape is 200 MB. In total, this CD (of those shapes as files) would total up to 550 MB.
5. Somebody then got a brainwave and said, what if I just wrote the file once, and told the cd drive (through the TOC) that the same file is in X number of positions.
So now, the 550 MB CD above becomes just 325 MB (how ? each file is written just once, and additional occurrences of the same file is re-directed to point to the same location.
6. Thus, we see that the software making the ISO sees that there are repetitions of the same file many times in many folders, and encodes the file itself only once, but makes hard-link entries to that file in the TOC.
7. The result is that the user sees that there are 35,000 files occupying 6 GB (for example) on a CD, but due to optimization, only the 4,000 unique files are really written, the rest are all "virtual" links contained in the TOC of the CD, so the CD is actually just 630 MB (just for example, of course).
Please post any questions you have about this matter, or links to other places where "optimization" of a CD image is very useful (so that people can see where and how such ISO images are used).
Here are some links to good guides that make use of optimized cd images.
1. Making an MS-Office 2003 Pro Edition AIO (all-in-one) CD.
Go here for a poll on the best CD-optimization tool.