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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]