Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re: RFC: Archive::Tar::Streamed

by ctilmes (Vicar)
on Jan 04, 2005 at 11:48 UTC ( #419209=note: print w/replies, xml ) Need Help??

in reply to RFC: Archive::Tar::Streamed

I had a similar need, but my files don't even exist on disk. I was building a web server that returns tars of files that came from other web servers. I never "cleanly" integrated my approach with Archive::Tar or packaged it up nicely, but here is the gist of it:

I take a callback from the caller, and call it to do any output. I pass the callback into HTTP::Request to retrieve the file from the remote site and pass it through to the web client.

for each file { HEAD the file on the remote server to get the file size use Archive::Tar::File's internal _format_tar_entry to write the t +ar header use HTTP::Request to retrieve the file from the remote server, pas +sing it the callback for output write TAR_PAD to fill out the BLOCK } write TAR_END x 2
Any ideas on a clean way to build a generic module that I could use are welcome...

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://419209]
[Discipulus]: 2 weekends ago LanX
[Lotus1]: cb is nsfw this morning
[Lotus1]: I wonder if ascii art would work in the cb....
[jedikaiti]: lolol
Tux looks up his status to find being an Abbot
[choroba]: pm-cb-g now shows the number of unread messages, commit on its way to github
[Tux]: choroba any plans for highlight patterns?

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (14)
As of 2017-09-20 16:02 GMT
Find Nodes?
    Voting Booth?
    During the recent solar eclipse, I:

    Results (237 votes). Check out past polls.