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

23
LINES

< > BotCompany Repo | #1014484 // readPersistentVarFromOtherProgram

JavaX fragment (include)

static O readPersistentVarFromOtherProgram(S progID, S variableName) ctex {
  bool allDynamic = false;
  File textFile = programFile(progID, variableName + ".text");
  S value = loadTextFile(textFile);
  if (value != null) ret value;
  File structureFile = programFile(progID, variableName + ".structure");
  value = loadTextFile(structureFile);
      
  if (nempty(value))
    ret allDynamic ? safeUnstructure(value) : unstructure(value);
    
  File structureGZFile = programFile(progID, variableName + ".structure.gz");
  if (!structureGZFile.isFile()) null;
  InputStream fis = new FileInputStream(structureGZFile);
  try {
    GZIPInputStream gis = newGZIPInputStream(fis);
    InputStreamReader reader = new InputStreamReader(gis, "UTF-8");
    BufferedReader bufferedReader = new BufferedReader(reader);
    ret unstructure_tok(javaTokC_noMLS_onReader(bufferedReader), allDynamic, null);
  } finally {
    fis.close();
  }
}

Author comment

Began life as a copy of #1001043

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: #1014484
Snippet name: readPersistentVarFromOtherProgram
Eternal ID of this version: #1014484/3
Text MD5: 34be9771dda3dde36dc3cd5043551854
Author: stefan
Category: javax / persistence
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-04-29 14:04:57
Source code size: 953 bytes / 23 lines
Pitched / IR pitched: No / No
Views / Downloads: 464 / 491
Version history: 2 change(s)
Referenced in: [show references]