Solaris/FreeBSD tar file incompatibility?

Matthew Seaman m.seaman at
Tue Oct 29 18:02:01 GMT 2002

On Tue, Oct 29, 2002 at 05:05:09PM +0000, adyas at wrote:

> Does anyone know of any tar incompatibilities between Solaris (8) and
> FreeBSD?  We're creating a tar file on a Solaris box, (around 200MB) and
> then attempting to un-tar it on a FreeBSD machine.  The archive looks
> different on the FreeBSD machine, files that were within directories now
> appear in the tar's root directory.
> We don't think the file is corrupt, having transfered the file (ftp) a
> number of times with the same results.
> Also, I'm sure I've done this before without any problems, I'm thinking
> maybe it's a file name length problem?
> The FreeBSD tar man page mentions -I for Solaris compatibility, but I 
> think that means the -I switch was added because Solaris has a -I switch.

tar(1) has a limit of 100 characters for the full length of any paths
recorded in it.  Gnu tar (which is what FreeBSD is using at the
moment) contains a hack to get around the problem, so you can use it
safely with any path length.  Solaris tar, as far as I know, doesn't
contain the fix.  So, yes, the tar formats are incompatible, but only
when you're tarring up a reasonably deep tree.

Either install Gnu tar on the Solaris box, or use find(1) + cpio(1) to
create the archive file and cpio(1) to extract on FreeBSD.  Note:
Solaris find(1) and cpio(1) don't have the options to work with null
separated lists of file names, so if your directory tree contains
filenames with spaces or other difficult characters you may not get
precisely the effect you desire.



Dr Matthew J Seaman MA, D.Phil.                       26 The Paddocks
                                                      Savill Way
Tel: +44 1628 476614                                  Bucks., SL7 1TH UK

More information about the Ukfreebsd mailing list