code: def writeFile(self, fname = None):
          
          if len(self._collectedTypes) < 2:
              recEncoding = self.peek().encoding()
          else:
              recEncoding = 'utf-8'
          if fname:
              f = open(fname, mode = 'w', encoding = recEncoding)
          else:
              f = open(self.name[:200] + '.txt', mode = 'w', encoding = recEncoding)
          if self._collectedTypes == {'WOSRecord'}:
              f.write("\ufeffFN Thomson Reuters Web of Science\u2122\n")
              f.write("VR 1.0\n")
          elif self._collectedTypes == {'MedlineRecord'}:
              f.write('\n')
          elif self._collectedTypes == {'ScopusRecord'}:
              f.write("\ufeff{}\n".format(','.join(scopusHeader)))
          for R in self._collection:
              R.writeRecord(f)
              f.write('\n')
          if self._collectedTypes == {'WOSRecord'}:
              f.write('EF')
          f.close()
docs: Writes the `RecordCollection` to a file, the written file's format is identical to those download from WOS. The order of `Records` written is random.
  
          # Parameters
  
          _fname_ : `optional [str]`
  
          > Default `None`, if given the output file will written to _fanme_, if `None` the `RecordCollection`'s name's first 200 characters are used with the suffix .isi