mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 13:37:45 +00:00
LibCore: Move Core::Stream::File::exists()
to Core::File
`Core::Stream::File` shouldn't hold any utility methods that are unrelated to constructing a `Core::Stream`, so let's just replace the existing `Core::File::exists` with the nicer looking implementation.
This commit is contained in:
parent
bd272e638c
commit
2fc2025f49
10 changed files with 14 additions and 18 deletions
|
@ -165,11 +165,6 @@ ErrorOr<NonnullOwnPtr<File>> File::adopt_fd(int fd, OpenMode mode, ShouldCloseFi
|
|||
return file;
|
||||
}
|
||||
|
||||
bool File::exists(StringView filename)
|
||||
{
|
||||
return !Core::System::stat(filename).is_error();
|
||||
}
|
||||
|
||||
ErrorOr<NonnullOwnPtr<File>> File::standard_input()
|
||||
{
|
||||
return File::adopt_fd(STDIN_FILENO, OpenMode::Read, ShouldCloseFileDescriptor::No);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue