提交 a04fd990 编写于 作者: D dangyifei

fix flush data and index overwrite file

上级 d5583371
......@@ -180,7 +180,7 @@ bool CROVLBuilderIncremental::flush_data() {
char file[MAX_DATA_DIR_LEN * 2];
snprintf(file, sizeof(file), "%s/data.%lu", _data_dir, _data_file);
FILE *fp;
if ((fp = fopen(file, "wb")) == NULL) {
if ((fp = fopen(file, "ab")) == NULL) {
LOG(ERROR) << "open file failed! " << file;
return false;
}
......@@ -209,7 +209,7 @@ bool CROVLBuilderIncremental::FlushIndex() {
char file[MAX_DATA_DIR_LEN * 2];
snprintf(file, sizeof(file), "%s/index.%d", _data_dir, _index_file_num);
FILE *fp;
if ((fp = fopen(file, "wb")) == NULL) {
if ((fp = fopen(file, "ab")) == NULL) {
LOG(ERROR) << "open file failed! " << file;
return false;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册