sbool applyPersistentMapLogFile_debug;

static void applyPersistentMapLogFile(S progID, S persistenceName, Map map, bool deleteFile) {
  File f = persistentMapLogFile(progID, persistenceName);
  applyPersistentMapLogFile(f, map, deleteFile);
}
  
static void applyPersistentMapLogFile(File f, Map map, bool deleteFile) {
  if (applyPersistentMapLogFile_debug)
    print("applyPersistentMapLogFile: Checking " + f);
  if (!f.exists()) ret;
  for (O _l : scanLog_safeUnstructure(f)) pcall {
    L l = cast _l;
    mapPut(map, first(l), second(l));
  }
  if (deleteFile) f.delete();
}