In article <ntrho8$c3p$
1...@gioia.aioe.org>,
You also have to check dynamically linked libraries:
sh-3.2$ otool -L /usr/bin/tar
/usr/bin/tar:
/usr/lib/libarchive.2.dylib (compatibility version 9.0.0, current version 9.2.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
sh-3.2$ strings /usr/lib/libarchive.2.dylib|grep -i 'pathname too long'
Pathname too long
And now we proceed to serious advice ("Use the Source, Luke."):
The most recent version of the source file on Apple's opensource web
site is
https://opensource.apple.com/source/libarchive/libarchive-33.20.2/libarchive/libarchive/archive_write_set_format_ustar.c
It looks like there are 100 bytes set aside for a pathname; if it's
too long, it tries to split it at a slash and store the rest
separately, but if there's a single name component (between slashes)
that's too long, it can fail.
Ideally, it would handle lengths up to the limits at which open(2)
fails with ENAMETOOLONG:
sh-3.2$ getconf PATH_MAX /
1024
sh-3.2$ getconf NAME_MAX /
255
(the whole pathname and a single level of the name, respectively;
those are however filesystem-specific limits, but that's typical for
an HFS+ filesystem)
Unfortunately, it looks to me like the already existing "tar" archive
format had that 100 character limitation. Archive formats are subject
to compatibility issues going WAY back, to when those limits were
lower. The limits for the tar and ustar formats are mentioned in the
"pax" man page:
PAX(1) BSD General Commands Manual PAX(1)
[...]
-x format
Specify the output archive format, with the default format being
ustar. pax currently supports the following formats:
bcpio The old binary cpio format. The default blocksize for
this format is 5120 bytes. This format is not very por-
table and should not be used when other formats are
available. Inode and device information about a file
(used for detecting file hard links by this format),
which may be truncated by this format, is detected by
pax and is repaired.
cpio The extended cpio interchange format specified in the
IEEE Std 1003.2 (``POSIX.2'') standard. The default
blocksize for this format is 5120 bytes. Inode and
device information about a file (used for detecting file
hard links by this format), which may be truncated by
this format, is detected by pax and is repaired.
sv4cpio The System V release 4 cpio. The default blocksize for
this format is 5120 bytes. Inode and device information
about a file (used for detecting file hard links by this
format), which may be truncated by this format, is
detected by pax and is repaired.
sv4crc The System V release 4 cpio with file CRC checksums.
The default blocksize for this format is 5120 bytes.
Inode and device information about a file (used for
detecting file hard links by this format), which may be
truncated by this format, is detected by pax and is
repaired.
tar The old BSD tar format as found in 4.3BSD. The default
blocksize for this format is 10240 bytes. Pathnames
stored by this format must be 100 characters or less in
length. Only regular files, hard links, soft links, and
directories will be archived (other file system types
are not supported). For backwards compatibility with
even older tar formats, a -o option can be used when
writing an archive to omit the storage of directories.
This option takes the form:
-o write_opt=nodir
ustar The extended tar interchange format specified in the
IEEE Std 1003.2 (``POSIX.2'') standard. The default
blocksize for this format is 10240 bytes. Filenames
stored by this format must be 100 characters or less in
length; the total pathname must be 255 characters or
less.
pax will detect and report any file that it is unable to store or
extract as the result of any specific archive format restric-
tions. The individual archive formats may impose additional
restrictions on use. Typical archive format restrictions include
(but are not limited to): file pathname length, file size, link
pathname length, and the type of the file.
What would I do? Probably use "pax" but specify the "cpio" format.
Why use pax instead of cpio? Because cpio expects to be fed a list of
newline-separated pathnames (usually from "find") on standard input,
but there _could_ be a newline embedded in a pathname, which it
couldn't distinguish from one ending a pathname in the input. Pax in
write mode behaves more like tar, and descends a directory argument,
so assuming the cpio format itself isn't bothered by newlines in a
pathname, and that it's limit is longer than the tar format (I haven't
actually checked those assumptions!), that's probably as good as
you're going to get with a standard and widely supported format.
--
ftp> get |fortune
377 I/O error: smart remark generator failed
Bogonics: the primary language inside the Beltway
Lasik/PRK theme music:
"In the Hall of the Mountain King", from "Peer Gynt"
(read act 2, scene 6 of the play if that doesn't make sense)