tar fs copy

Guy Harris guy at sun.uucp
Tue Oct 22 17:10:19 AEST 1985


> Our 4.2 version of tar.c doesnot have a -C option nor does the man page
> says so.

Wanna bet?  Here's the relevant page, snatched from "/usr/man/man/tar.1"
right off the 4.2 tape:

	If a file name is preceded by 
	.BR \-C ,
	then 
	.I tar
	will perform a
	.IR chdir (2)
	to that file name.  This allows multiple directories not
	related by a close common parent to be archived using short
	relative path names.  For example, to archive files from /usr/include
	and from /etc, one might use
	.ti +0.5i
	tar c -C /usr include -C / etc

It's in the "tar" source as well.  You just didn't check the whole manual
page or the whole source file.

> In the search of the 'C' option, i found an 'F' option.  Again, no comment,
> no man page coverage.  

It is rather a hack - it prevents directory files with the name SCCS and
plain files which:

	have a name of one or two characters in length
	have a name ending in ".o"
	have the name "core" or "errs"
	or, in some circumstances, have the name "a.out"

from being put onto a tape.  Presumably, this is so that only source files -
not SCCS files, object files, executable images (there is a comment saying
"SHOULD CHECK IF IT IS EXECUTABLE", although since they have a "stat" of the
file I have no idea why they *don't* so check), or droppings like core dumps
and "errs" files - I believe it is a custom to redirect the output of
compiles, or the error output anyway, to "errs".

It is probably not documented 1) because it *is* such a hack and 2) because
there is no guarantee that it will be in all subsequent 4.xBSD releases.

	Guy Harris



More information about the Comp.unix.wizards mailing list