tar with switches leads to stack dump

Joe Smith unknown_kev_cat@hotmail.com
Thu Dec 22 19:35:00 GMT 2005


> 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/



More information about the Cygwin mailing list