1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 09:34:59 +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:
Tim Schumacher 2022-12-07 21:34:00 +01:00 committed by Sam Atkins
parent bd272e638c
commit 2fc2025f49
10 changed files with 14 additions and 18 deletions

View file

@ -9,7 +9,7 @@
#include <AK/GenericLexer.h>
#include <AK/Time.h>
#include <LibCore/ArgsParser.h>
#include <LibCore/Stream.h>
#include <LibCore/File.h>
#include <LibCore/System.h>
#include <LibMain/Main.h>
#include <LibTimeZone/TimeZone.h>
@ -239,7 +239,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
atime.tv_nsec = UTIME_OMIT;
for (auto path : paths) {
if (Core::Stream::File::exists(path)) {
if (Core::File::exists(path)) {
if (utimensat(AT_FDCWD, path.characters(), times, 0) == -1)
err("failed to touch '{}': {}", path, strerror(errno));
} else if (!no_create_file) {