diff --git a/Userland/Utilities/fortune.cpp b/Userland/Utilities/fortune.cpp index 2769bda343..1d70ecc729 100644 --- a/Userland/Utilities/fortune.cpp +++ b/Userland/Utilities/fortune.cpp @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #include #include @@ -75,19 +75,19 @@ ErrorOr serenity_main(Main::Arguments arguments) { TRY(Core::System::pledge("stdio rpath")); - char const* path = "/res/fortunes.json"; + StringView path = "/res/fortunes.json"sv; Core::ArgsParser args_parser; args_parser.set_general_help("Open a fortune cookie, receive a free quote for the day!"); args_parser.add_positional_argument(path, "Path to JSON file with quotes (/res/fortunes.json by default)", "path", Core::ArgsParser::Required::No); args_parser.parse(arguments); - auto file = TRY(Core::File::open(path, Core::OpenMode::ReadOnly)); + auto file = TRY(Core::Stream::File::open(path, Core::Stream::OpenMode::Read)); TRY(Core::System::unveil("/etc/timezone", "r")); TRY(Core::System::unveil(nullptr, nullptr)); - auto file_contents = file->read_all(); + auto file_contents = TRY(file->read_all()); auto json = TRY(JsonValue::from_string(file_contents)); if (!json.is_array()) { warnln("{} does not contain an array of quotes", path);