I'm just learning Rust, and trying to use the tar crate to extract a single file from a tar archive.
I'm wondering if there is a way to extract the contents of a single file from the tar archive without writing the file to disk. Does anyone know if that is possible?
As far as I can tell, it seems like the unpack
functions all expect a Path
, assuming that you want to write the contents of the file to disk somewhere.
For Example
Say I have a .tar
with a bunch of files in it, but I just need one .json
or .csv
file in there. I don't need to write that file to disk, I just need to use the data in that file to do some other stuff.
Writing the file to disk wouldn't be the end of the world, but since this is Rust, I figured there might be a way to avoid that I/O