However you can do it by going via the local disk. The code below copies
/dir1 from the first handle to
/dir2 in the second handle:
g1.tar_out ("/dir1", "/tmp/temp.tar") g2.tar_in ("/tmp/temp.tar", "/dir2")
In real code you should choose a randomly named temporary file to avoid tmp exploits.
If your handles were managed by separate threads, then you could do this more efficiently without the local disk by using a pipe.