(POSIX 1003.1 USTAR)

From oldwiki.scinet.utoronto.ca
Revision as of 10:19, 28 July 2011 by Pinto (talk | contribs)
Jump to navigation Jump to search

POSIX 1003.1 USTAR

From the htar manual:

When specifying path names that are greater than 100 characters for a file (POSIX 1003.1 USTAR) format, remember that the path name is composed of a prefix buffer, a / (slash), and a name buffer.

The prefix buffer can be a maximum of 155 bytes and the name buffer can hold a maximum of 100 bytes. Since some implementations of TAR require the prefix and name buffers to terminate with a null (? ?) character, HTAR enforces the restriction that the effective prefix buffer length is 154 characters (+ trailing zero byte), and the name buffer length is 99 bytes (+ trailing zero byte).

If the path name cannot be split into these two parts by a slash, it cannot be archived. This limitation is due to the structure of the tar archive headers, and must be maintained for compliance with standards and backwards compatibility. In addition, the length of a destination for a hard or symbolic link ( the ?link name?) cannot exceed 100 bytes (99 characters + zero-byte terminator).

In the example below the file will be skipped with a false positive "HTAR: HTAR SUCCESSFUL" message, even though HTAR lists all the files omitted.

htar -cpf /archive/$(id -gn)/$(whoami)/fromScratch/test.tar very_long_pathname/aaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbb/cccccccccccccccccc/ddddddddddddddddddddd/eeeeeeeeeeeeeeeeeeee/ffffffffffffffffffff/gggggggggggggggggg/hhhhhhhhhhhhhhhhhh/iiiiiiiiiiiiiiiii/jjjjjjjjjjjjjjjj/kkkkkkkkkkkkkkkkkkk/lllllllllllllllll/file

----------------------------------------
INFO:
Warning: name too long for tar archive- file omitted
INFO:
[very_long_pathname/aaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbb/cccccccccccccccccc/ddddddddddddddddddddd/eeeeeeeeeeeeeeeeeeee/ffffffffffffffffffff/gggggggggggggggggg/hhhhhhhhhhhhhhhhhh/iiiiiiiiiiiiiiiii/jjjjjjjjjjjjjjjj/kkkkkkkkkkkkkkkkkkk/lllllllllllllllll/file]
HTAR: HTAR SUCCESSFUL

BACK TO HPSS