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 2022/04/27 08:25:40 UTC

[GitHub] [nifi-minifi-cpp] fgerlits commented on a diff in pull request #1311: MINIFICPP-1807 improve stat() error logging

fgerlits commented on code in PR #1311:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1311#discussion_r859518869


##########
extensions/standard-processors/processors/GetFile.cpp:
##########
@@ -232,27 +232,24 @@ std::queue<std::string> GetFile::pollListing(uint64_t batch_size) {
 bool GetFile::fileMatchesRequestCriteria(std::string fullName, std::string name, const GetFileRequest &request) {
   logger_->log_trace("Checking file: %s", fullName);
 
-#ifdef WIN32
-  struct _stat64 statbuf;
-  if (_stat64(fullName.c_str(), &statbuf) != 0) {
-    return false;
+  std::error_code ec;
+  uint64_t file_size = std::filesystem::file_size(fullName, ec);
+  if (ec) {
+    logger_->log_error("file_size of %s: %s", fullName, ec.message());

Review Comment:
   I think a `return false;` is missing after this line



-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org