making filenames more dynamic
This commit is contained in:
parent
37ed6ddf8f
commit
65b2afd76f
1 changed files with 5 additions and 3 deletions
8
pcp.go
8
pcp.go
|
@ -5,13 +5,15 @@ import (
|
|||
"log"
|
||||
"os"
|
||||
"os/exec"
|
||||
"time"
|
||||
)
|
||||
|
||||
func main() {
|
||||
cmd := exec.Command("sh", "-c", "pmdumptext -m -l -o -d , -c config")
|
||||
stdout, err := os.Create("./output.txt")
|
||||
time := time.Now().Format("200601021504")
|
||||
stdout, err := os.Create("./"+time+".txt")
|
||||
cmd.Stdout = stdout
|
||||
fmt.Println("PCP started: ", stdout)
|
||||
fmt.Println("PCP started: ")
|
||||
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
|
@ -22,4 +24,4 @@ func main() {
|
|||
if err := cmd.Wait(); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue