Forums

Can we create tar on the fly in python

Please suggest on how to tar a directory on the fly and without saving the tar directory.Or please suggest on how to create tar on file object

so you want to create a tar of a directory but you don't want to save it?

Hi Yes, i want to create tar without saving it anywhere.And want to pipe that tar to other process in python. Please suggest on how to procees

maybe something like this https://superuser.com/a/439669

Hi I have used the linux commands for taring on the fly using subprocess . But sunprocess is blocking other processes.

Please suggest any other process in python for taring on the fly

You might be able to use the tarfile module that is in the Python standard library if you want to write the tar file to an open file handle.