diff --git a/file.go b/file.go index d038cc3..59f113b 100644 --- a/file.go +++ b/file.go @@ -71,14 +71,13 @@ func (f *file) export(dstPath string) error { return err } - f.rewind() - fh, err := os.Create(dstPath) if err != nil { return err } defer fh.Close() + f.rewind() if _, err := f.WriteTo(fh); err != nil { return err }