Richards Center at Yale University
RC Home | Search | Table of Contents | General Information

Last Modified: Wednesday, 31-May-2006 16:29:52 EDT

Splitting archives over multiple DVDs

The original software, as modified from Brookhaven, simply traversed the directory tree in order. Files were added to a list for the first CD/DVD until the total size of the files filled the media. Then a new list was started for the next CD/DVD.

Beginning with barebones.1.2.0 (2006.05.31), the following algorithm is used:

  1. If a directory is too large for a single DVD/CD, get the size of all individual files and subdirectories.
  2. For any subdirectory too large for a single DVD/CD, descend into that directory and repeat this algorithm.
  3. In alphabetical order, combine as many individual files from this directory onto a DVD/CD. Repeat until all individual files are used up.
  4. For subdirectories whose size is less than a DVD/CD, add them to fill a DVD/CD. Continue until all subdirectories are accounted for.
  5. We now have a list of DVD/CDs, each containing one or more files and/or directories contained in a single directory. Go through this list, combining media where possible.

This algorithm has the foillowing advantages:

Last Modified: Wednesday, 31-May-2006 16:29:52 EDT


RC Home | Search | Table of Contents | General Information
Richards Center (www.rc.yale.edu) at Yale University (www.yale.edu)
Contact: webmaster_at_ben^rc^yale^edu