tôi thực hiện quá trình với Go và viết ra để nộp (file log)Golang là nó an toàn để chuyển cmd.Stdout
cmd := exec.Command(path)
cmd.Dir = dir
t := time.Now()
t1 := t.Format("20060102-150405")
fs, err := os.Create(dir + "/var/log/" + t1 + ".std")
if err == nil {
cmd.Stdout = fs
}
Tôi muốn để xoay bản ghi và thay đổi bản ghi tập tin hàng ngày http://golang.org/pkg/os/exec/
// Stdout and Stderr specify the process's standard output and error.
//
// If either is nil, Run connects the corresponding file descriptor
// to the null device (os.DevNull).
//
// If Stdout and Stderr are the same writer, at most one
// goroutine at a time will call Write.
Stdout io.Writer
Stderr io.Writer
Có an toàn khi thay đổi cmd.Không thay đổi hàng ngày từ goroutine arbitary hoặc tôi phải thực hiện goroutine sẽ sao chép từ Stdout sang tệp khác và chuyển đổi tệp?