diff --git a/src/core/hle/service/fs/file.cpp b/src/core/hle/service/fs/file.cpp index e31f89d0e7..f91cbee99b 100644 --- a/src/core/hle/service/fs/file.cpp +++ b/src/core/hle/service/fs/file.cpp @@ -90,7 +90,7 @@ void File::Write(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(2, 2); - const FileSessionSlot* file = GetSessionData(ctx.Session()); + FileSessionSlot* file = GetSessionData(ctx.Session()); // Subfiles can not be written to if (file->subfile) { @@ -103,6 +103,10 @@ void File::Write(Kernel::HLERequestContext& ctx) { std::vector data(length); buffer.Read(data.data(), 0, data.size()); ResultVal written = backend->Write(offset, data.size(), flush != 0, data.data()); + + // Update file size + file->size = backend->GetSize(); + if (written.Failed()) { rb.Push(written.Code()); rb.Push(0);