code: def Save(self, filename, env):
          
  
          # Create the file and write out the header
          try:
              fh = open(filename, 'w')
  
              try:
                  # Make an assignment in the file for each option
                  # within the environment that was assigned a value
                  # other than the default.
                  for option in self.options:
                      try:
                          value = env[option.key]
                          try:
                              prepare = value.prepare_to_store
                          except AttributeError:
                              try:
                                  eval(repr(value))
                              except KeyboardInterrupt:
                                  raise
                              except:
                                  # Convert stuff that has a repr() that
                                  # cannot be evaluated into a string
                                  value = SCons.Util.to_String(value)
                          else:
                              value = prepare()
  
                          defaultVal = env.subst(SCons.Util.to_String(option.default))
                          if option.converter:
                              defaultVal = option.converter(defaultVal)
  
                          if str(env.subst('${%s}' % option.key)) != str(defaultVal):
                              fh.write('%s = %s\n' % (option.key, repr(value)))
                      except KeyError:
                          pass
              finally:
                  fh.close()
  
          except IOError as x:
              raise SCons.Errors.UserError('Error writing options to file: %s\n%s' % (filename, x))
docs: Saves all the options in the given file.  This file can
          then be used to load the options next run.  This can be used
          to create an option cache file.
  
          filename - Name of the file to save into
          env - the environment get the option values from