delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/12/22/14:29:57

X-Spam-Check-By: sourceware.org
To: cygwin AT cygwin DOT com
From: "Joe Smith" <unknown_kev_cat AT hotmail DOT com>
Subject: Re: tar with switches leads to stack dump
Date: Thu, 22 Dec 2005 14:29:32 -0500
Lines: 44
Message-ID: <doeuqu$pvs$1@sea.gmane.org>
References: <000001c60608$8ab30190$500210ac AT tcgp DOT dundee DOT ac DOT uk> <43A952A1 DOT 4050906 AT byu DOT net>
Mime-Version: 1.0
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

> I still don't see why upstream refuses to update a compressed archive, but
> at least it didn't abort.

Gnu tar will not allow the use of '-r or -u' when a tar file is given on 
stdin.

I assume that compressed archives work using tar as a filter, instead of 
using potentially huge temporary files.
This means that '-r or -u' could not work with the compressed archives.



Now a small (ok... mid-sized) rant:

Apparently these operations which (the manual indicates) do not make any 
changes to the body of the
archive, but mearly append more data to the end requires random access to 
the file.

For -r, all that tar should need to do is output the input file in its 
entiretry, except the End_Of_File marker,
then output what 'tar -A filenames' would. Simple... Should have absolutely 
no need to do anything requireing random access.

For -u, things are a bit different.
It should dereference the files. The files should be placed into a dynamicly 
allocated (unfortunate, but I can see
no way around it for archives inputted on std-in) array of a struct similar 
to this:

struct input {
char[] string_that_indicates_where_the_file_is_on_the_disk;
char[] path_inside_the_archive;
int time_file_on_disk_was_last_modified;
bool 
there_is_a_file_with_the_same_path_inside_the_archive_last_modified_at_the_same_time_or_after_
    time_file_on_disk_was_last_modified;
}

Hmm... I guess those strings would also need to go on the heap. Anyway, scan 
the input while duping it to standard out,
setting the bools as needed, again leaving off the the End_Of_File marker. 
Then append what "tar -A filesWithBoolSetToFalse" would output.



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019