File tree Expand file tree Collapse file tree 1 file changed +2
-17
lines changed
Expand file tree Collapse file tree 1 file changed +2
-17
lines changed Original file line number Diff line number Diff line change @@ -389,23 +389,8 @@ std::vector<directory_entry> Posix::ls_with_sizes(
389389
390390Status Posix::ls (
391391 const std::string& path, std::vector<std::string>* paths) const {
392- struct dirent * next_path = nullptr ;
393- auto dir = PosixDIR::open (path);
394- if (dir.empty ()) {
395- return {};
396- }
397-
398- while ((next_path = readdir (dir.get ())) != nullptr ) {
399- if (!strcmp (next_path->d_name , " ." ) || !strcmp (next_path->d_name , " .." )) {
400- continue ;
401- }
402- std::string abspath = path + " /" + next_path->d_name ;
403-
404- if (next_path->d_type == DT_DIR) {
405- paths->emplace_back (abspath);
406- } else {
407- paths->emplace_back (abspath);
408- }
392+ for (auto & fs : ls_with_sizes (URI (path), false )) {
393+ paths->emplace_back (fs.path ().native ());
409394 }
410395
411396 return Status::Ok ();
You can’t perform that action at this time.
0 commit comments