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

5
LINES

< > BotCompany Repo | #1001314 // processIDExists - check if process ID exists (rough method, may have false positives)

JavaX fragment (include)

static boolean processIDExists(S pid) ctex {
  S cmd = isWindows() ? "tasklist" : "ps -aef";
  L<S> output = toLines(backtick(cmd));
  return !grep("java", grep(pid, output)).isEmpty();
}

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: #1001314
Snippet name: processIDExists - check if process ID exists (rough method, may have false positives)
Eternal ID of this version: #1001314/1
Text MD5: 085b3dcd7d173679ea66cbd87fa7ad52
Author: stefan
Category:
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-10-09 18:45:24
Source code size: 191 bytes / 5 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 549 / 788
Referenced in: [show references]