Skip to content

Commit

Permalink
dump: flush buffered writes
Browse files Browse the repository at this point in the history
Conflicts:
	dump/write.go
  • Loading branch information
godsic authored and barnex committed Nov 13, 2014
1 parent 693badb commit 3fef72c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion dump/write.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package dump

import (
"bufio"
"github.com/mumax/3/data"
"github.com/mumax/3/util"
"hash"
Expand Down Expand Up @@ -50,7 +51,9 @@ func WriteFile(fname string, s *data.Slice, info data.Meta) error {
return err
}
defer f.Close()
return Write(f, s, info)
w := bufio.NewWriter(f)
defer w.Flush()
return Write(w, s, info)
}

// Write the slice to file in binary format, panic on error.
Expand Down

1 comment on commit 3fef72c

@godsic
Copy link
Contributor Author

@godsic godsic commented on 3fef72c Nov 13, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks

Please sign in to comment.