bakaid commented on a change in pull request #558: MINIFICPP-542 - Add PutSFTP 
processor
URL: https://github.com/apache/nifi-minifi-cpp/pull/558#discussion_r285089242
 
 

 ##########
 File path: libminifi/include/utils/file/FileUtils.h
 ##########
 @@ -196,6 +200,29 @@ class FileUtils {
     return 0;
   }
 
+#ifndef WIN32
+  static bool get_permissions(const std::string &path, uint32_t &permissions) {
+    struct stat result;
+    if (stat(path.c_str(), &result) == 0) {
+      permissions = result.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO);
+      return true;
+    }
+    return false;
+  }
+#endif
+
+#ifndef WIN32
+  static bool get_uid_gid(const std::string &path, uint64_t &uid, uint64_t 
&gid) {
+    struct stat result;
+    if (stat(path.c_str(), &result) == 0) {
 
 Review comment:
   I'm not sure what you mean. The st_uid and st_uid fields will always be 0 in 
the Windows version of stat 
(https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/stat-functions?view=vs-2019).
 I may be able to figure the owner out with GetSecurityInfo, but a simple 
uid-gid is not really applicable on Windows AFAIK.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to