diff options
author | Tim Schumacher <timschumi@gmx.de> | 2022-12-07 21:34:00 +0100 |
---|---|---|
committer | Sam Atkins <atkinssj@gmail.com> | 2022-12-08 12:52:14 +0000 |
commit | 2fc2025f49bb974a46afdf2242489ab0fe5a5cba (patch) | |
tree | e7565af2a4b432991c70180b9a7e7f90b2dc3e0b /Userland/Libraries/LibCore/Stream.cpp | |
parent | bd272e638cc33e3282ffde1052eafd15cd00eac5 (diff) | |
download | serenity-2fc2025f49bb974a46afdf2242489ab0fe5a5cba.zip |
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.
Diffstat (limited to 'Userland/Libraries/LibCore/Stream.cpp')
-rw-r--r-- | Userland/Libraries/LibCore/Stream.cpp | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/Userland/Libraries/LibCore/Stream.cpp b/Userland/Libraries/LibCore/Stream.cpp index 3ff6ba837f..3f198cb760 100644 --- a/Userland/Libraries/LibCore/Stream.cpp +++ b/Userland/Libraries/LibCore/Stream.cpp @@ -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); |