mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 04:18:14 +00:00
LibCore: Add Core::Stream::File::exists()
This commit is contained in:
parent
8a854ba309
commit
244357472a
2 changed files with 6 additions and 0 deletions
|
@ -117,6 +117,11 @@ ErrorOr<NonnullOwnPtr<File>> File::adopt_fd(int fd, OpenMode mode)
|
|||
return file;
|
||||
}
|
||||
|
||||
bool File::exists(StringView filename)
|
||||
{
|
||||
return !Core::System::stat(filename).is_error();
|
||||
}
|
||||
|
||||
int File::open_mode_to_options(OpenMode mode)
|
||||
{
|
||||
int flags = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue