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

28
LINES

< > BotCompany Repo | #1001466 // hyperMoveAnother (move another program between two machines)

JavaX fragment (include)

static boolean hyperMoveAnother(S progID, S machine1, S machine2) ctex {
  S botID = formatSnippetID(progID);
  
  print("Hyper-Move: Checking applicability.");
  if (!canHyperMove(botID)) {
    print("Hyper-Move: Can't move, not on this machine.");
    ret false;
  }
  
  print("Hyper-Move: Killing bot to move it...");
  killProgramID(botID);
  print("Hyper-Move: OK, done.");

  S destMachine = getComputerID().equals(machine2) ? machine1 : machine2;
  print("Hyper-Move: Moving " + botID + " to " + destMachine + "...");
  
  File zipPath = new File(getProgramDir(), botID + ".zip");
  boolean hasData = zipBot(botID, zipPath);
  
  S title = "Data zip of " + botID + " on " + computerID() + " at " + now();
  S gummipw = getProgramID() + "-hypermove";
  S dataID = hasData ? uploadDataSuperHigh(gummipw, title, zipPath) : "#1001471" /* no data */;
  
  sendToRemoteBot("Identity Manager", format3("* is now in state * with data * to machine *", botID, "moving", dataID, destMachine));
  
  print("\nDone. Data ID: " + dataID);
  ret true;
}

Author comment

Began life as a copy of #1001368

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: #1001466
Snippet name: hyperMoveAnother (move another program between two machines)
Eternal ID of this version: #1001466/1
Text MD5: bdf22cfdf299570989379c6bcc659f6f
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-10-17 19:27:07
Source code size: 1073 bytes / 28 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 685 / 843
Referenced in: [show references]