code: func CaptureOutputToFile(path string) error {
  	fh, err := os.OpenFile(path, os.O_RDWR|os.O_CREATE, 0644)
  	if err != nil {
  		return err
  	}
  	defer fh.Close()
  	return CaptureOutputToFd(int(fh.Fd()))
  }
docs: // CaptureOutputToFile opens a filehandle using the given path, then calls
  // CaptureOutputToFd on the associated filehandle.