Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

17
LINES

< > BotCompany Repo | #1010718 // applyPersistentMapLogFile

JavaX fragment (include)

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();
}

Author comment

Began life as a copy of #1010717

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1010718
Snippet name: applyPersistentMapLogFile
Eternal ID of this version: #1010718/5
Text MD5: d033ff20c7a65d42e7d49960591f3ee4
Author: stefan
Category: javax / lists
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-05-10 16:37:50
Source code size: 597 bytes / 17 lines
Pitched / IR pitched: No / No
Views / Downloads: 455 / 476
Version history: 4 change(s)
Referenced in: [show references]