tsfile icon indicating copy to clipboard operation
tsfile copied to clipboard

[CPP].Does the CPP version support append writing?

Open t59688 opened this issue 1 year ago • 1 comments

Does the C++ version support appending to files? I haven't found any examples of appending in the test and sample code; it seems like the file is deleted and recreated each time, whereas the Java version does support appending。

C++

int TsFileWriter::open(const std::string &file_path, int flags, mode_t mode) {
    if (check_file_exist(file_path)) {
        return E_ALREADY_EXIST;
    }

java

    try (ForceAppendTsFileWriter fwriter = new ForceAppendTsFileWriter(f)) {
      fwriter.doTruncate();
      write(fwriter);
    } catch (Exception e) {
      LOGGER.error("ForceAppendTsFileWriter truncate or write error ", e);
    }
  }

t59688 avatar Sep 24 '24 09:09 t59688

Currently, it is not supported, but it will be in the future. All features implemented on all Java versions will eventually be implemented on the CPP version.

ColinLeeo avatar Sep 24 '24 15:09 ColinLeeo