Tk Library Source Code

View Ticket
Login
Ticket UUID: 3162548
Title: tar -- support existing/nonseekable channels
Type: Bug Version: None
Submitter: ferrieux Created on: 2011-01-20 11:04:07
Subsystem: tar Assigned To: andreas_kupries
Priority: 8 Severity:
Status: Closed Last Modified: 2011-01-21 02:46:14
Resolution: Accepted Closed By: andreas_kupries
    Closed on: 2011-01-20 19:46:14
Description:
The attached patch adds a "-chan" option to [contents/stat/get/untar/create]  (but *not* [add/remove], foor good reasons), which interprets the first argument as a channel name instead of filename. This allows to pass already opened channels, seekable or not. One typical usage is the emulation of 'tar cf - | ...':

   ::tar::create  $pipe  $listoffiles -chan

Which is typically useful for Wub, to serve content that is to be tarred on-the-fly, instead of (currently) using tempfiles.
The same applies on input, where seek is emulated by repeated reads when the channel is not seekable; similarly a "tar tf -" can thus be done on any pipe or socket.

Note that the responsibility for 'fconfigure -translation binary' is left to the caller; only raw IO are done on the provided channel, and it is left open on return. 

I have not included the (needed) documentation update; I would appreciate a hand since I don't have the renderer handy ;-)
User Comments: andreas_kupries added on 2011-01-21 02:46:14:

allow_comments - 1

Applied to head. Re-indented.
Package version bumped to 0.7
Updated documentation.

ferrieux added on 2011-01-20 18:05:06:
pushing prio after chat with Andreas ;-)

ferrieux added on 2011-01-20 18:04:07:

File Added - 399270: tarchan.patch

Attachments: