Selective untar into a FIFO pipe. Not optimal in this case but you can work around the limitation with some extra work. I'd rather do this than expose some 0-day due to odd combination of rarely used libraries.
Or memfd + mmap + /proc/<pid>/fd for those libraries that unconditionally want to seek.
This also works for annoying APIs like execve ;)
That's likely the use case for 99% of people who zip things though or play audio. Your corner case is exactly what simple libraries should avoid.
Re:Curious lack of sprintf scaling
by pie_flavor on Friday February 25, 2022 @09:16PM
(#30474731)
The only thing they're going to do is open it as an ifstream. Zero value is gained over taking an istream instead; initializing it is one bit of extra code for the user, in exchange for being able to pull in data from anywhere. Embedding it in the binary might be rare, but how about stdin? Or for that matter the Internet?
I've seen audio libraries where you can only provide a file path for playback. Guess you're screwed if you wanted to get a Vorbis file out of a tarball, decode it silently faster than real-time, and send it over the network...