Skip to content

Commit

Permalink
delete file by name instead of referencing the dataFile pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
chrislusf committed Nov 5, 2018
1 parent c77c4e3 commit f9dbaf6
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions weed/storage/volume_read_write.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,8 @@ func (v *Volume) Destroy() (err error) {
err = fmt.Errorf("%s is read-only", v.dataFile.Name())
return
}
defer v.Close()
err = os.Remove(v.dataFile.Name())
if err != nil {
return
}
v.Close()
os.Remove(v.FileName() + ".dat")
err = v.nm.Destroy()
os.Remove(v.FileName() + ".cpd")
os.Remove(v.FileName() + ".cpx")
Expand Down

0 comments on commit f9dbaf6

Please sign in to comment.