adamdebreceni commented on a change in pull request #1015:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1015#discussion_r582594812
##########
File path: extensions/standard-processors/processors/GetFile.cpp
##########
@@ -228,42 +228,48 @@ void GetFile::pollListing(std::queue<std::string> &list,
const GetFileRequest &r
bool GetFile::acceptFile(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;
+ }
+#else
struct stat statbuf;
+ if (stat(fullName.c_str(), &statbuf) != 0) {
+ return false;
+ }
+#endif
- if (stat(fullName.c_str(), &statbuf) == 0) {
- if (request.minSize > 0 && statbuf.st_size < (int32_t) request.minSize)
- return false;
-
- if (request.maxSize > 0 && statbuf.st_size > (int32_t) request.maxSize)
- return false;
+ if (request.minSize > 0 && statbuf.st_size < request.minSize)
Review comment:
added gsl::narrow casts
##########
File path: libminifi/include/utils/file/FileUtils.h
##########
@@ -248,18 +248,16 @@ inline uint64_t last_write_time(const std::string &path) {
if (ec.value() == 0) {
return result;
}
-#else
-#ifdef WIN32
- struct _stat result;
- if (_stat(path.c_str(), &result) == 0) {
+#elif WIN32
Review comment:
done
----------------------------------------------------------------
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:
[email protected]