Hi, I see where I go wrong now, confirmed by Tim's note "Each file system object requires a header record which stores basic metadata (pathname, owner, permissions, etc.) and zero or more records containing any file data.".
I didn't think about the directories, that if storing aaaaa/bbbbb/ccccc this requires three blocks (yes, saw that but didn't think about what it means to the limitations). aaaaa/ aaaaa/bbbbb/ aaaaa/bbbbb/ccccc And with some USTAR readers assuming the "name" field can't be empty, this makes the limitations much worse than the current GNU tar implementation of the USTAR standard. I now also understand your hesitation to make this change the default, as it limits USTAR quite a bit to be compatible with Solaris TAR and others. On the other hand I understand your argument that those specifying --format=ustar likely are after compatibility with legacy USTAR implementations. So with the restriction that the "name" field is not to be empty, no component of the path can be more than 100 characters, and a directory part can't be more than 99 characters excluding the ending slash. I adjusted my test case to cover the more limited legacy use of the standard, and added one run with my own patch on GNU tar. My patch is a bit verbose and likely overdoing it (I'm not working as a developer, I'm a build guy), but anyway, it is there as a reference and for these particular tests it makes GNU tar compatible with Sun tar. There are likely many bugs in my split code, one I know of is that it will allocate a header even if the function returns NULL. And the actual split loop is ugly, I hate those add and subtract from the index. I also dump the header "name" and "prefix" from the resulting TAR files into the test log, where it can be seen that GNU tar (even with your earlier patch) still split in an unfortunate way if trying to be compatible with Solaris TAR and others. What happens is that the "name" field sometimes still becomes empty, kent
TARERR3.gz
Description: Binary data
ustartest
Description: Binary data
gnutar-split.c
Description: Binary data
-- Kent Boortz, Senior Production Engineer Sun Microsystems Inc., the MySQL team Office: +46 863 11 363 Mobile: +46 70 279 11 71
