code: def scons_copytree(src, dst, symlinks=False):
      
      names = os.listdir(src)
      # garyo@genarts.com fix: check for dir before making dirs.
      if not os.path.exists(dst):
          os.makedirs(dst)
      errors = []
      for name in names:
          srcname = os.path.join(src, name)
          dstname = os.path.join(dst, name)
          try:
              if symlinks and os.path.islink(srcname):
                  linkto = os.readlink(srcname)
                  os.symlink(linkto, dstname)
              elif os.path.isdir(srcname):
                  scons_copytree(srcname, dstname, symlinks)
              else:
                  shutil.copy2(srcname, dstname)
              # XXX What about devices, sockets etc.?
          except (IOError, os.error) as why:
              errors.append((srcname, dstname, str(why)))
          # catch the CopytreeError from the recursive copytree so that we can
          # continue with other files
          except CopytreeError as err:
              errors.extend(err.args[0])
      try:
          shutil.copystat(src, dst)
      except SCons.Util.WinError:
          # can't copy file access times on Windows
          pass
      except OSError as why:
          errors.extend((src, dst, str(why)))
      if errors:
          raise CopytreeError(errors)
docs: Recursively copy a directory tree using copy2().
  
      The destination directory must not already exist.
      If exception(s) occur, an CopytreeError is raised with a list of reasons.
  
      If the optional symlinks flag is true, symbolic links in the
      source tree result in symbolic links in the destination tree; if
      it is false, the contents of the files pointed to by symbolic
      links are copied.
  
      XXX Consider this example code rather than the ultimate tool.