Re: constants for tar header offsets

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: constants for tar header offsets
Date: 2023-04-18 16:06:09
Message-ID: 2661235.1681833969@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> On Tue, Apr 18, 2023 at 11:38 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> 2. The header size is defined as 512 bytes, but this doesn't sum to 512:
>> + TAR_OFFSET_PREFIX = 345 /* 155 byte string */

> I think that what happened is that whoever designed the original tar
> format decided on 512 byte blocks. And the header did not take up the
> whole block. The USTAR format is an extension of the original format
> which uses more of the block, but still not all of it.

Hmm, you're right: I checked the POSIX.1-2018 spec as well, and
it agrees that the prefix field is 155 bytes long. Perhaps just
add another comment line indicating that 12 bytes remain unassigned?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nikita Malakhov 2023-04-18 16:12:08 Re: [PATCH] Compression dictionaries for JSONB
Previous Message Robert Haas 2023-04-18 15:53:08 Re: constants for tar header offsets