Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
chain33-pai
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ligaishun
chain33-pai
Commits
a818bdbd
Commit
a818bdbd
authored
Dec 10, 2019
by
ligaishun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Delete process_before.txt
parent
4806eba6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
52 deletions
+0
-52
process_before.txt
pkg/app/process_before.txt
+0
-52
No files found.
pkg/app/process_before.txt
deleted
100644 → 0
View file @
4806eba6
package app
import (
"bytes"
"io"
"os/exec"
"time"
)
type ProcessInfo struct {
PName string `json:"p_name"`
Pid string `json:"pid"`
User string `json:"user"`
Path string `json:"path"`
}
func GetProcessInfo(keyfile string)bytes.Buffer{
var buffer bytes.Buffer
var buffer_res bytes.Buffer
lsof := exec.Command("lsof")
grep := exec.Command("grep", keyfile)
head := exec.Command("head","-n","1")
read, write := io.Pipe() // Create a pipe
defer read.Close()
defer write.Close()
lsof.Stdout = write //write output into pipe write
grep.Stdin = read // grep read from pipe
grep.Stdout = &buffer// grep output
lsof.Start()
grep.Start()
lsof.Wait()
write.Close()
grep.Wait()
head.Stdin=&buffer
head.Stdout=&buffer_res
head.Start()
head.Wait()
return buffer_res
}
func StrFilter(str []string)(res []string){
for i:=0;i<len(str);i++{
if str[i]!=""{
res=append(res,str[i])
}
}
return
}
func CornProcessJob(times ){
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment