This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author edulix
Recipients christian.heimes, edulix, lars.gustaebel, loewis, serhiy.storchaka
Date 2014-04-13.09:27:19
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1397381241.16.0.496692025901.issue18321@psf.upfronthosting.co.za>
In-reply-to
Content
> The example I gave is based on the idea that there is a TarVolumeSet class in the tarfile module that implements all the required file-object methods (e.g.  read(), write(), seek(), etc.) and acts as if the sequence of volumes is actually one big file. It is passed to tarfile.open() as the fileobj argument. This TarVolumeSet class is supposed to be subclassable to let the user implement her/his own mode of operation. This way the open_volume() method can do whatever the user wants it to do. The TarVolumeSet class might as well have a new_volume() method for writing multivol archives, the example only covered the case of reading a multivol archive.

This is not so easy, because for example if you want to move the logic in addfile() that manages volumes to the write() function, you have some issues:
 * write() will need to take into account blocks (BLOCKSIZE), just to be able to split the volumes correctly. This is something that usually shouldn't belong in a write() function as it has to do to tarfile.. and it can be messy that both layers deal with it (write() splitting volumes, and tarfile adding NUL at the end of a BLOCK..) This can be done I guess, but remember, we split a volume only in the middle of a big file, not in any other case (AFAIK). Hopefully you don't get huge pax headers or anything strange. Usually all other records are either in the begining or just occupy one block, but can we rule this problem out for good?

 * multivolume logic in write() needs read/write access to the current tarinfo being written (look for "tarfile" in addfile() funcion in my patch to see why). How do you propose this object should be accessed from write()? 

> BTW, my version of GNU tar refuses to create compressed multiple-volume archives which is why I doubt the usefulness of this feature overall.

But it has multivolume support right? Which is what I am proposing here. Also, you can gzip (or encrypt or anything) the volumes after creating the volumes..

>> [...] because a multivol tarfile is not exactly the same as a normal tarfile chopped up.
> No, I think it is exactly that. The only purpose of the GNUTYPE_MULTIVOL header that is at the start of each subsequent volume is to give GNU tar the ability to detect if it is reading the correct volume. It is not essential and could as well be left out.

I'm not going to discuss this, because I think that we can implement it in the way you propose to implement it anyway. But my patch supports it and I think it's an *useful* feature, so I want it in :-P
History
Date User Action Args
2014-04-13 09:27:21edulixsetrecipients: + edulix, loewis, lars.gustaebel, christian.heimes, serhiy.storchaka
2014-04-13 09:27:21edulixsetmessageid: <1397381241.16.0.496692025901.issue18321@psf.upfronthosting.co.za>
2014-04-13 09:27:21edulixlinkissue18321 messages
2014-04-13 09:27:19edulixcreate