From bbcb6a09c44f1c8b931f0078b85eef66c508986e Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Sat, 30 May 2015 17:30:25 -0700 Subject: [PATCH] close file when the process closes. --- process/process.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/process/process.go b/process/process.go index a74a0f96..308c11a6 100644 --- a/process/process.go +++ b/process/process.go @@ -74,6 +74,10 @@ func Create(mode int, label string, execPath string, args []string, input string } } proc.EndTime = time.Now() // TODO make this goroutine-safe + err = proc.OutputFile.Close() + if err != nil { + fmt.Printf("Error closing output file for %v: %v\n", proc.Label, err) + } close(proc.WaitCh) }() return proc, nil