You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/04/02 02:31:54 UTC

[GitHub] [arrow] ArianaVillegas commented on a change in pull request #12625: ARROW-15587: [C++] Add support for all options specified by substrait::ReadRel::LocalFiles::FileOrFiles

ArianaVillegas commented on a change in pull request #12625:
URL: https://github.com/apache/arrow/pull/12625#discussion_r840995798



##########
File path: cpp/src/arrow/util/io_util.cc
##########
@@ -663,19 +664,26 @@ std::wstring PathWithoutTrailingSlash(const PlatformFilename& fn) {
   return path;
 }
 
-Result<std::vector<WIN32_FIND_DATAW>> ListDirInternal(const PlatformFilename& dir_path) {
+Result<std::vector<WIN32_FIND_DATAW>> ListDirInternal(const PlatformFilename& dir_path,
+                                                      bool is_glob = false) {
   WIN32_FIND_DATAW find_data;
-  std::wstring pattern = PathWithoutTrailingSlash(dir_path) + L"\\*.*";
+  std::wstring pattern;
+  if (is_glob)
+    pattern = dir_path.ToNative();
+  else
+    pattern = PathWithoutTrailingSlash(dir_path) + L"\\*.*";
+
+  std::vector<WIN32_FIND_DATAW> results;
   HANDLE handle = FindFirstFileW(pattern.c_str(), &find_data);
   if (handle == INVALID_HANDLE_VALUE) {
+    if (is_glob) return results;

Review comment:
       The idea is that if a glob doesn't match any file, it should return an empty vector.




-- 
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: github-unsubscribe@arrow.apache.org

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