mirror of
https://github.com/lifegpc/eh-downloader.git
synced 2026-07-08 01:31:00 +08:00
Upload files
This commit is contained in:
13
pid_check.ts
Normal file
13
pid_check.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
export async function check_running(pid: number) {
|
||||
if (Deno.build.os == "windows") {
|
||||
const cmd = new Deno.Command("tasklist.exe", {
|
||||
args: ["/NH", "/FI", `pid eq ${pid}`],
|
||||
stdout: "piped",
|
||||
});
|
||||
const c = cmd.spawn();
|
||||
const o = await c.output();
|
||||
if (o.code !== 0) return;
|
||||
const s = (new TextDecoder()).decode(o.stdout);
|
||||
return s.indexOf(`${pid}`) !== -1;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user