mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 07:17:35 +00:00
LibCore: Expose DirIterator's underlying file descriptor
This commit is contained in:
parent
e7310ba45a
commit
758085571f
2 changed files with 8 additions and 0 deletions
|
@ -99,4 +99,11 @@ String find_executable_in_path(String filename)
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int DirIterator::fd() const
|
||||||
|
{
|
||||||
|
if (!m_dir)
|
||||||
|
return -1;
|
||||||
|
return dirfd(m_dir);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,6 +29,7 @@ public:
|
||||||
bool has_next();
|
bool has_next();
|
||||||
String next_path();
|
String next_path();
|
||||||
String next_full_path();
|
String next_full_path();
|
||||||
|
int fd() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DIR* m_dir = nullptr;
|
DIR* m_dir = nullptr;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue