What exactly is the GNU tar ././@LongLink “trick”?

前端 未结 2 1764
死守一世寂寞
死守一世寂寞 2020-12-28 17:33

I read that a tar entry type of \'L\' (76) is used by gnu tar and gnu-compliant tar utilities to indicate that the next entry in the archive has a \"long\" name. In this c

2条回答
  •  再見小時候
    2020-12-28 17:48

    Just by observation of a single archive here's what I surmised about the 'L' entry type in tar archives, and the "././@LongLink" name:

    The 'L' entry is present in a header for a series of 1 or more 512-byte blocks that hold just the filename for a file or directory with a name over 100 chars. For example, if the filename is 1200 chars long, then the size in the header block will be 1200, and there will be 3 additional blocks with filename data; the last block is partially filled.

    Following that series is another header block, in the traditional form - a header with type '0' (regular file) or '5' (directory), followed by the appropriate number of data blocks with the entry data. In the header for this series, the name will be truncated to the first 100 characters of the actual name.

    EDIT
    See my implementation here: http://cheesoexamples.codeplex.com/SourceControl/changeset/view/99885#1868643

提交回复
热议问题