You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2019/04/23 16:14:31 UTC

[GitHub] [nifi-minifi-cpp] phrocker commented on a change in pull request #540: MINIFICPP-809: Better support python capabilities and recordreader/wr…

phrocker commented on a change in pull request #540: MINIFICPP-809: Better support python capabilities and recordreader/wr…
URL: https://github.com/apache/nifi-minifi-cpp/pull/540#discussion_r277759614
 
 

 ##########
 File path: libminifi/src/io/FileStream.cpp
 ##########
 @@ -28,12 +28,15 @@ namespace nifi {
 namespace minifi {
 namespace io {
 
-FileStream::FileStream(const std::string &path)
+FileStream::FileStream(const std::string &path, bool append)
     : logger_(logging::LoggerFactory<FileStream>::getLogger()),
       path_(path),
       offset_(0) {
   file_stream_ = std::unique_ptr<std::fstream>(new std::fstream());
-  file_stream_->open(path.c_str(), std::fstream::out | std::fstream::binary);
+  if (append)
+    file_stream_->open(path.c_str(), std::fstream::in | std::fstream::out | std::fstream::app | std::fstream::binary);
 
 Review comment:
   That bit sets the flag to allow output operations to append at the end but there is nothing to suggest we won't be reading. Further, we need to be able to read and seek to get length. We don't want to obviate user's intent. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services