public void output(long pid) throws SigarException { String[] argv = this.proxy.getProcArgs(pid); try { String exe = this.proxy.getProcExe(pid).getName(); println("exe=" + exe); } catch (SigarNotImplementedException e) { } catch (SigarException e) { println("exe=???"); } try { String cwd = this.proxy.getProcExe(pid).getCwd(); println("cwd=" + cwd); } catch (SigarNotImplementedException e) { } catch (SigarException e) { println("cwd=???"); } for (int i=0; i<argv.length; i++) { println(" " + i + "=>" + argv[i] + "<="); } }
for (int n = 0; n < list.length; n++) { try { proc = sigar.getProcExe(list[n]); } catch (SigarException e) { log.debug("Can't get process exe for pid " + list[n], e);
private long getPIDByProcName(String name, long index) { int procIndex = 0; long[] list; ProcExe proc; try { list = sigar.getProcList(); } catch (SigarException ex) { log.error("Failed to get process list", ex); return -1; } for (int n = 0; n < list.length; n++) { try { proc = sigar.getProcExe(list[n]); } catch (SigarException e) { log.debug("Can't get process exe for pid " + list[n], e); continue; } // case insensitive match String pname = proc.getName().toLowerCase(); if (pname.endsWith(File.separator + name.toLowerCase())) { if (procIndex == index) { return list[n]; } procIndex++; } } return -1; }
for (int n = 0; n < list.length; n++) { try { proc = sigar.getProcExe(list[n]); } catch (SigarException e) { log.debug("Can't get process exe for pid " + list[n], e);
private long getPIDByProcName(String name, long index) { int procIndex = 0; long[] list; ProcExe proc; try { list = sigar.getProcList(); } catch (SigarException ex) { log.error("Failed to get process list", ex); return -1; } for (int n = 0; n < list.length; n++) { try { proc = sigar.getProcExe(list[n]); } catch (SigarException e) { log.debug("Can't get process exe for pid " + list[n], e); continue; } // case insensitive match String pname = proc.getName().toLowerCase(); if (pname.endsWith(File.separator + name.toLowerCase())) { if (procIndex == index) { return list[n]; } procIndex++; } } return -1; }
procExe = sigar.getProcExe(pid); } catch (Exception e) { handleSigarCallException(e, "getProcExe");
procExe = sigar.getProcExe(pid); } catch (Exception e) { handleSigarCallException(e, "getProcExe");