Uwe Kleine-König [off-list ref] writes:
Junio C Hamano wrote:
quoted
We could write it as "$(TAR) Ccf blt - ." if we can rely on the
'C' option, but I suspect it is a GNU extension. Does anybody
have POSIX.1 handy?
I don't have POSIX.1 handy, but on Solaris 10, you need to say:
tar cf - -C blt .
(That is, Solaris' tar has the 'C' option, which is quite a good
indication, that it's included in POSIX :-)
Oh, I cannot resist ;-)
Solaris has unlink(2) capable of removing a directory, but I do
not think it is included in POSIX.
El 17/7/2007, a las 20:37, Junio C Hamano escribió:
Uwe Kleine-König [off-list ref] writes:
quoted
Junio C Hamano wrote:
quoted
We could write it as "$(TAR) Ccf blt - ." if we can rely on the
'C' option, but I suspect it is a GNU extension. Does anybody
have POSIX.1 handy?
I don't have POSIX.1 handy, but on Solaris 10, you need to say:
tar cf - -C blt .
(That is, Solaris' tar has the 'C' option, which is quite a good
indication, that it's included in POSIX :-)
Oh, I cannot resist ;-)
Solaris has unlink(2) capable of removing a directory, but I do
not think it is included in POSIX.
I'd say the answer is "no", "C" isn't in the POSIX tar specification.
The latest, Version 3, says "the Shell and Utilities volume of IEEE
Std 1003.1-2001 no longer contains the tar utility" (<http://
www.opengroup.org/onlinepubs/009695399/basedefs/tar.h.html>).
And Version 2, which does contain tar, does not list "C" as an option
(<http://www.opengroup.org/onlinepubs/7990989775/xcu/tar.html>).
In fact, the example they give for moving directory hierarchies is
exactly this:
(cd fromdir; tar cf - . ) | (cd todir; tar xf -)
Cheers,
Wincent
Hello Junio,
Junio C Hamano wrote:
Uwe Kleine-König [off-list ref] writes:
quoted
(That is, Solaris' tar has the 'C' option, which is quite a good
indication, that it's included in POSIX :-)
Oh, I cannot resist ;-)
Solaris has unlink(2) capable of removing a directory, but I do
not think it is included in POSIX.
I don't have access to the POSIX documents, but it would surprise me if
they forbid unlink(2) being able to unlink directories. :-)
You need some effort to support tar -C and to catch directories in
unlink. So Sun put the effort in tar, because it may be needed to be
conformant to POSIX or some other standard.
Best regards
Uwe
--
Uwe Kleine-König
<script>alert("This is a virus for Outlook")</script>