mini-bitcask icon indicating copy to clipboard operation
mini-bitcask copied to clipboard

你好,这里有个小bug,此处文件已经close,后面便无法读取了

Open codeflysafe opened this issue 2 years ago • 1 comments

		// 获取文件名
		mergeDBFileName := mergeDBFile.File.Name()
		// 关闭文件
		mergeDBFile.File.Close()
		// 临时文件变更为新的数据文件
		os.Rename(mergeDBFileName, db.dirPath+string(os.PathSeparator)+FileName)
                // x 此处文件已经关闭了,应该重新打开
		db.dbFile = mergeDBFile

      ->
		db.dbFile =  NewDBFile(db.dirPath)

codeflysafe avatar Apr 08 '22 15:04 codeflysafe

同问,但感觉这边的merge作者只是给了个例子

acechef avatar May 20 '22 10:05 acechef