opendal icon indicating copy to clipboard operation
opendal copied to clipboard

Support TAR file?

Open Berrysoft opened this issue 2 years ago • 6 comments

I have authored vfs-tar: https://github.com/Berrysoft/vfs-tar

If you would like it, I'd like to author a readonly tar accessor.

Berrysoft avatar Jan 20 '23 07:01 Berrysoft

Seems interesting! I have considered adding tar support before.

I have a few questions about the implementations:

  • Can we accept an Object (which could be on s3/gcs instead of local fs) as input? so that we can operate tar files on any storages (which is opendal's VISION).
    • we can use the ObjectReader's seek support to read file header only instead of the whole content.
  • Can you split tar-parser related logic into separate repo?
    • So vfs-tar can share the same parser with opendal?

Xuanwo avatar Jan 23 '23 16:01 Xuanwo

I'm planning on spliting tar-parser. I have also noticed that nom supports the read-like streams. There should be no big problems to do so.

However, I'd like to support large tar files without large memory usage. That's why I use mmap in vfs-tar now. If Object is used, is this goal still possible?

Berrysoft avatar Jan 24 '23 07:01 Berrysoft

If Object is used, is this goal still possible?

Yes. We only need to scan and store the tar headers which served as index. Content will be fetched while users calling read.

Xuanwo avatar Jan 24 '23 08:01 Xuanwo

Well, I somehow suspect that. Anyway it worth a try. I will split tar-parser out when I am free and will inform the prgress here.

Berrysoft avatar Jan 24 '23 08:01 Berrysoft

I will split tar-parser out when I am free and will inform the prgress here.

Thanks in advance!

Xuanwo avatar Jan 24 '23 08:01 Xuanwo

tar-parser is published: https://crates.io/crates/tar-parser2

vfs-tar is also updated to use it: https://crates.io/crates/vfs-tar

Berrysoft avatar Jan 29 '23 04:01 Berrysoft

It seems unsuitable for implementation in OpenDAL. Let's close this issue.

Xuanwo avatar Dec 19 '23 04:12 Xuanwo