New API Reader for uefi.protocol.File

I’m trying to create an uefi application for a side project in Zig 0.16.0.
I am trying to use std.elf.Header.iterateProgramHeaders but the problem is that this functions recieves a new std.Io.File.Reader as a parameter, and the std.os.uefi.protocol.File struct removed the reader() method. Now you only have a read() that writes on a buffer.
I’ve searched for an implementation of a reader and I found nothing.
Does any body know how to convert a std.os.uefi.protocol.File to the new std.Io.File?

I’m not sure why it was removed but would reading the UEFI to a buffer and then using Zig Documentation work?

1 Like

Thanks for the answer.
Yeah that’s how I’ve ended up, but I was courious if there is a better approach.
It seem ugly to me to first read the entire file again instead of reusing the File object provided by uefi and reading dynamically.

Regarding to the reason of removing that, what I understood from what I read over other posts is the Reader API relies in many POSIX functions such as seekl, which are not defined in the UEFI File protocol. I guess it would be either impossible or super dificult to implement them to create a wraper reader for uefi files.