std.fs.pread

std.fs

pread(fd, count, offset) -> data, err

Read from a file descriptor at an offset

Reads up to count bytes at offset, 0 by default, and leaves the fd's position alone. Wraps pread(2): it reads until count or the end of the file, and retries on EINTR. A read past the end gives a short or empty string, not an error.