diff --git a/Userland/Applications/SoundPlayer/Playlist.cpp b/Userland/Applications/SoundPlayer/Playlist.cpp index 5454e85322..d245ddc8ba 100644 --- a/Userland/Applications/SoundPlayer/Playlist.cpp +++ b/Userland/Applications/SoundPlayer/Playlist.cpp @@ -39,7 +39,7 @@ void Playlist::try_fill_missing_info(Vector& entries, StringView path) entry.path = ByteString::formatted("{}/{}", playlist_path.dirname(), entry.path); if (!entry.extended_info->file_size_in_bytes.has_value()) { - auto size = FileSystem::size(entry.path); + auto size = FileSystem::size_from_stat(entry.path); if (size.is_error()) continue; entry.extended_info->file_size_in_bytes = size.value(); diff --git a/Userland/Libraries/LibFileSystem/FileSystem.cpp b/Userland/Libraries/LibFileSystem/FileSystem.cpp index 2486e55ea5..a931eea9df 100644 --- a/Userland/Libraries/LibFileSystem/FileSystem.cpp +++ b/Userland/Libraries/LibFileSystem/FileSystem.cpp @@ -350,7 +350,7 @@ ErrorOr remove(StringView path, RecursionMode mode) return {}; } -ErrorOr size(StringView path) +ErrorOr size_from_stat(StringView path) { auto st = TRY(Core::System::stat(path)); return st.st_size; diff --git a/Userland/Libraries/LibFileSystem/FileSystem.h b/Userland/Libraries/LibFileSystem/FileSystem.h index d750880078..b520986ed2 100644 --- a/Userland/Libraries/LibFileSystem/FileSystem.h +++ b/Userland/Libraries/LibFileSystem/FileSystem.h @@ -71,7 +71,7 @@ ErrorOr copy_directory(StringView destination_path, StringView source_path ErrorOr copy_file_or_directory(StringView destination_path, StringView source_path, RecursionMode = RecursionMode::Allowed, LinkMode = LinkMode::Disallowed, AddDuplicateFileMarker = AddDuplicateFileMarker::Yes, PreserveMode = PreserveMode::Nothing); ErrorOr move_file(StringView destination_path, StringView source_path, PreserveMode = PreserveMode::Nothing); ErrorOr remove(StringView path, RecursionMode); -ErrorOr size(StringView path); +ErrorOr size_from_stat(StringView path); bool can_delete_or_move(StringView path); ErrorOr read_link(StringView link_path); diff --git a/Userland/Services/WebServer/Client.cpp b/Userland/Services/WebServer/Client.cpp index 27d6250d64..ebc56823e9 100644 --- a/Userland/Services/WebServer/Client.cpp +++ b/Userland/Services/WebServer/Client.cpp @@ -170,7 +170,7 @@ ErrorOr Client::handle_request(HTTP::HttpRequest const& request) auto const info = ContentInfo { .type = TRY(String::from_utf8(Core::guess_mime_type_based_on_filename(real_path.bytes_as_string_view()))), - .length = TRY(FileSystem::size(real_path.bytes_as_string_view())) + .length = static_cast(TRY(FileSystem::size_from_stat(real_path.bytes_as_string_view()))) }; TRY(send_response(*stream, request, move(info))); return true; diff --git a/Userland/Services/WebServer/Client.h b/Userland/Services/WebServer/Client.h index 19e5a0f6e7..dc6fc29d43 100644 --- a/Userland/Services/WebServer/Client.h +++ b/Userland/Services/WebServer/Client.h @@ -28,7 +28,7 @@ private: struct ContentInfo { String type; - size_t length {}; + u64 length {}; }; ErrorOr on_ready_to_read();