Sam,

> From: Sam Ruby [mailto:[EMAIL PROTECTED]
>
> Take a close look at TarOutputStream.putNextEntry.  See if you come to the
> same conclusion that I did - namely before my change truncate meant omit.
> What do you think should be done?

You mean this code:
if (entry.getName().length() >= TarConstants.NAMELEN) {

    if (longFileMode == LONGFILE_GNU) {
        // create a TarEntry for the LongLink, the contents
        // of which are the entry's name
        TarEntry longLinkEntry = new TarEntry(TarConstants.GNU_LONGLINK,

TarConstants.LF_GNUTYPE_LONGNAME);

        longLinkEntry.setSize(entry.getName().length() + 1);
        putNextEntry(longLinkEntry);
        write(entry.getName().getBytes());
        write(0);
        closeEntry();
    }
    else if (longFileMode != LONGFILE_TRUNCATE) {
        throw new RuntimeException("file name '" + entry.getName()
                                     + "' is too long ( > "
                                     + TarConstants.NAMELEN + " bytes)");
    }
}


If longFileMode is set to truncate, this code will drop out of the if
statement. In that case, the following code in TarEntry

    offset = TarUtils.getNameBytes(this.name, outbuf, offset, NAMELEN);

will truncate the name to 100 chars (NAMELEN)


>
> OK, I plead guitly to laziness.  Answer my previous question and then I
> will do the necessary cleanup.  I also assume that you are otherwise OK
> with the warn behavior I have implemented?
>

Yep. I think I said in my original commit that this was needed so I am happy
that you are doing it :-)

Conor

Reply via email to