The right tool for the job: positioned IO for Zip archives

from blog nickb.dev, | ↗ original
pread is a little known POSIX API that allows one to issue file reads at an arbitrary offset in a thread-safe fashion, as it won’t mutate the file’s underlying cursor. The Linux man-pages give us insight into pread’s usefulness along with its sibling, pwrite. The pread() and pwrite() system calls are especially useful in multithreaded...