def conf_file
      vmx_path = File.join path, "*.vmx"
      conf_files = Dir.glob vmx_path

      response = Response.new

      case conf_files.count
      when 0
        response.code = 1
        response.message = "Unable to find a config file for VM '#{@name}' (in '#{vmx_path}')"
      when 1
        response.code = 0
        response.data = conf_files.first
      else
        if conf_files.include?(File.join(File.dirname(vmx_path), "#{@name}.vmx"))
          response.code = 0
          response.data = File.join(File.dirname(vmx_path), "#{@name}.vmx")
        else
          response.code = 1
          output = "Multiple config files found for VM '#{@name}' ("
          output << conf_files.sort.map { |f| "'#{File.basename(f)}'" }.join(', ')
          output << " in '#{File.dirname(vmx_path)}')"
          response.message = output
        end
      end

      response
    end
def conf_file
      vmx_path = File.join path, "*.vmx"
      conf_files = Dir.glob vmx_path

      response = Response.new

      case conf_files.count
      when 0
        response.code = 1
        response.message = "Unable to find a config file for VM '#{@name}' (in '#{vmx_path}')"
      when 1
        response.code = 0
        response.data = conf_files.first
      else
        if conf_files.include?(File.join(File.dirname(vmx_path), "#{@name}.vmx"))
          response.code = 0
          response.data = File.join(File.dirname(vmx_path), "#{@name}.vmx")
        else
          response.code = 1
          output = "Multiple config files found for VM '#{@name}' ("
          output << conf_files.sort.map { |f| "'#{File.basename(f)}'" }.join(', ')
          output << " in '#{File.dirname(vmx_path)}')"
          response.message = output
        end
      end

      response
    end
Public: Determines the path to the VM's config file ('.vmx').

 Examples

   @vm.conf_file.data
   # => '/my_vms/foo/foo.vmx'

 Returns a Response with the result.
 If successful, the Response's data attribute will be a String which will
 be escaped for spaces (' ').
 If there is a single '.vmx' file in the VM's directory, regardless if
 the name of '.vmx' file matches the VM name, the Response's data
 attribute will the be the path to the '.vmx' file.
 If there are multiple '.vmx' files found in the VM's directory, there are
 a couple of different possible outcomes.
 If one of the file names matches the VM directory name, then the
 Response's data attribute will be the path to the matching '.vmx' file.
 If none of the file names match the VM directory name, then this is deemed
 an error condition and an unsuccessful Response will be returned.
 If there is an error, an unsuccessful Response will be returned.