dogename的个人镜像,超前版本,GitHub:https://github.com/lensferno/dogename
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
353 B
21 lines
353 B
package utils
|
|
|
|
import (
|
|
"fmt"
|
|
"path/filepath"
|
|
)
|
|
|
|
func FindDogeProcess(dogePath string) (bool, []string) {
|
|
pids, _ := filepath.Glob(dogePath + "/process/*")
|
|
|
|
if pids == nil {
|
|
return false, nil
|
|
} else {
|
|
for i := 0; i < len(pids); i++ {
|
|
pids[i] = filepath.Base(pids[i])
|
|
}
|
|
fmt.Println("[Process]found pids:", pids)
|
|
return true, pids
|
|
}
|
|
|
|
}
|
|
|