Closed mengwanguc closed 2 years ago
Hello,
Can we use aiofiles to asynchronously read tar files?
Synchronously, we can do this using tarfile:
with tarfile.open(path) as archive: for entry in archive.getmembers(): with archive.extractfile(entry) as f: contents = f.read()
Is there an async way to do this hopefully with the help of aiofiles?
Yeah, put that code into a function and run it using get_running_loop().run_in_executor(None, func) ;)
get_running_loop().run_in_executor(None, func)
I think this would be a little out of scope of aiofiles.
Hello,
Can we use aiofiles to asynchronously read tar files?
Synchronously, we can do this using tarfile:
Is there an async way to do this hopefully with the help of aiofiles?