LibCore: Expose DirIterator's underlying file descriptor

This commit is contained in:
Mart G 2021-05-14 21:05:18 +02:00 committed by Andreas Kling
parent e7310ba45a
commit 758085571f
Notes: sideshowbarker 2024-07-18 18:08:21 +09:00
2 changed files with 8 additions and 0 deletions

View file

@ -99,4 +99,11 @@ String find_executable_in_path(String filename)
return {};
}
int DirIterator::fd() const
{
if (!m_dir)
return -1;
return dirfd(m_dir);
}
}

View file

@ -29,6 +29,7 @@ public:
bool has_next();
String next_path();
String next_full_path();
int fd() const;
private:
DIR* m_dir = nullptr;