def makeBackupFile(outFile)
      backupFileName = outFile+"~"
      if File.exists? backupFileName
        puts "BACKUP: deleting existing backup file #{backupFileName} ..."
        File.delete (backupFileName)
      end
      if File.exists? outFile
        puts "BACKUP: renaming file #{outFile} to #{backupFileName} ..."
        File.rename(outFile, backupFileName)
      end
      backupFileName
    end
def makeBackupFile(outFile)
      backupFileName = outFile+"~"
      if File.exists? backupFileName
        puts "BACKUP: deleting existing backup file #{backupFileName} ..."
        File.delete (backupFileName)
      end
      if File.exists? outFile
        puts "BACKUP: renaming file #{outFile} to #{backupFileName} ..."
        File.rename(outFile, backupFileName)
      end
      backupFileName
    end
If an old version of an output file exists, rename it to same file with "~" at the end.
 If that file (an earlier backup file) exists, delete it first.