docs: def setdirs(outfiles):
      """Create the directories if need be"""
      for k in outfiles:
          fname=outfiles[k]
          dname= os.path.dirname(fname)
          if not os.path.isdir(dname):
              os.mkdir(dname)