Re: empty archive
groan. Forget it. I hadn't noticed I don't have the ability to append to an archive. I'll go the long way round then zzz D In article memo.20110202170803.13524K@postmaster+dexdyne.com.cix.co.uk, from_busybox_maill...@dexdyne.com (David Collier) wrote: *From:* David Collier from_busybox_maill...@dexdyne.com *To:* busybox@busybox.net *Date:* Wed, 2 Feb 2011 17:08 + (GMT Standard Time) Is there any way to strong-arm busybox's tar into creating an empty archive? ( I need to add to it with xargs ) I really need to add files into an initially empty archive ( no I don't want to start with a dummy file. ) busybox refuses to play nicely with tar -cf test -T /dev/null or tar -cf test /dev/null so is there any other way to get there? TVM D ___ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox ___ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox
RE: empty archive
busybox refuses to play nicely with tar -cf test -T /dev/null or tar -cf test /dev/null so is there any other way to get there? As with all unixen there's always another way! Once upon a time tar files were simple enough that you could concatenate them. Perhaps that is no longer true? You could experiment, then compress the cat result later. An alternative: find . | tar zcfT outfile /proc/self/fd/0 -- Jim ___ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox
Re: empty archive
On 2 February 2011 18:55, Cathey, Jim jcat...@ciena.com wrote: busybox refuses to play nicely with tar -cf test -T /dev/null or tar -cf test /dev/null so is there any other way to get there? As with all unixen there's always another way! Once upon a time tar files were simple enough that you could concatenate them. Perhaps that is no longer true? You could experiment, then compress the cat result later. An alternative: find . | tar zcfT outfile /proc/self/fd/0 Urgh! # find . -depth -print | pax -wd outfile.tar That would be more portable (not all systems have /proc) Chris ___ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox
RE: empty archive
# find . -depth -print | pax -wd outfile.tar That would be more portable (not all systems have /proc) Not all systems have a nice place you can safely write a list file, either. One would also need to arrange to clean up this file afterwards, and to make sure it was not included in the list itself, or else is given to tar as an exclusion. Ideally the list file is auto-generated, and's a name that can never collide. mktemp stuff. Either way, potential complications. I'm still trying to get used to /proc/self/fd/0 versus /dev/stdin! -- Jim ___ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox
Re: empty archive
On Wednesday 02 February 2011 20:58, Cathey, Jim wrote: # find . -depth -print | pax -wd outfile.tar That would be more portable (not all systems have /proc) Not all systems have a nice place you can safely write a list file, either. One would also need to arrange to clean up this file afterwards, and to make sure it was not included in the list itself, or else is given to tar as an exclusion. Ideally the list file is auto-generated, and's a name that can never collide. mktemp stuff. Either way, potential complications. I'm still trying to get used to /proc/self/fd/0 versus /dev/stdin! find . -depth -print | tar ... -T - but you need a small fix for -T - to read stdin: -- vda diff -ad -urpN busybox.5/archival/tar.c busybox.6/archival/tar.c --- busybox.5/archival/tar.c2011-01-31 05:50:34.0 +0100 +++ busybox.6/archival/tar.c2011-02-03 03:59:05.0 +0100 @@ -655,7 +655,7 @@ static llist_t *append_file_list_to_list llist_t *newlist = NULL; while (list) { - src_stream = xfopen_for_read(llist_pop(list)); + src_stream = xfopen_stdin(llist_pop(list)); while ((line = xmalloc_fgetline(src_stream)) != NULL) { /* kill trailing '/' unless the string is just / */ char *cp = last_char_is(line, '/'); ___ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox