mainGNU tar - Support: sr #108529, List of files read completely with...

 
 

sr #108529: List of files read completely with -T option?

Submitter:  Kirill Müller <krlmlr>
Submitted:  Wed 12 Mar 2014 09:31:54 AM UTC
   
 
Category:  None Priority:  5 - Normal
Severity:  3 - Normal Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open Operating System:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 02 Apr 2014 09:11:42 PM UTC, comment #1: 

After manually removing some instances of -Wstack-protector in two Makefile-s I was able to compile tar. Indeed, the compiled version processes the files on the fly in my test script.

Test version: f24b30ec8ca1851b7bd1, perhaps 26538c9bfc5fd726 is responsible for the changed behavior.

Kirill Müller <krlmlr>
Wed 12 Mar 2014 09:31:54 AM UTC, original submission:  

I was looking for a way to dump files into a tar archive as they are created and deleting them as soon as they are dumped. The following approach does not work as expected on my system:

for ((f = 0; $f < 10000; f++)); do
  touch $f; echo $f;
done | tar -c -f ../otf.tar -T - --remove-files

The archive is created, but only after all files have been created. Why does the -T option read the entire list of files first?

$ tar --version
tar (GNU tar) 1.26

I have peeked into the code, and it seems to me that the list of files should be read incrementally:

http://git.savannah.gnu.org/cgit/tar.git/tree/src/create.c#n1404

Why is it not?

See also http://unix.stackexchange.com/q/119141/19205 -- a workaround using cpio is shown there, but I had hoped this would work in tar, too.

Unfortunately, I can't compile tar from source on my system (Ubuntu 13.04):

  CC     argp-help.o
argp-help.c: In function ‘hol_usage’:
argp-help.c:1347:1: error: stack protector not protecting local variables: variable length buffer [-Werror=stack-protector]
argp-help.c: In function ‘_help’:
argp-help.c:1589:1: error: stack protector not protecting local variables: variable length buffer [-Werror=stack-protector]

Thank you for your help!

Kirill Müller <krlmlr>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by krlmlr (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code