diff --git a/cube/cube-builder/src/crovl_builder_increment.cpp b/cube/cube-builder/src/crovl_builder_increment.cpp index 69732071ceee8d717682880229f56fa033d4165d..44ec01f90f87b3c87d01ed7d3b7ccedf19d50a9c 100644 --- a/cube/cube-builder/src/crovl_builder_increment.cpp +++ b/cube/cube-builder/src/crovl_builder_increment.cpp @@ -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; }