Fix sorted needle file's write mode for (*SortedFileNeedleMap).Delete() (#5633)

This commit is contained in:
NyaMisty 2024-06-03 05:12:25 +08:00 committed by GitHub
parent 3ddfd15ec1
commit f2a37933b1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -27,7 +27,7 @@ func NewSortedFileNeedleMap(indexBaseFileName string, indexFile *os.File) (m *So
}
glog.V(1).Infof("Opening %s...", fileName)
if m.dbFile, err = os.Open(indexBaseFileName + ".sdx"); err != nil {
if m.dbFile, err = os.OpenFile(indexBaseFileName+".sdx", os.O_RDWR, 0); err != nil {
return
}
dbStat, _ := m.dbFile.Stat()