On Tuesday 12 September 2006 08:17, Rob Dixon wrote: > One you have downloaded the remote file to memory or to local file storage > you can then open either of them and access them through a filehandle. Will > that do? > > Tell us a little more and we may be able to help better. Imagine I'm downloading a 10Gb file. I can't put it in memory, there's not enough space. I don't want to write it to disk because I might fill the disk, and it also slows the whole operation down. What I want to be be able to do is pass it, line-by-line (or n-byte block by n-byte block is probably better in case it's not text) as it's downloading to another program that is the one that's processing it. There's no need, and perhaps no possibility, to have all the content pre-downloaded in one place, but it can be processed on the fly.
However, to do this, I need it as a handle. It should be possible, as opening a socket gives you a filehandle (well, something that behaves like one). For more concreteness, the test case I wrote to test the bit that the content is being sent to is: open(my $infh, "<t/svntest1.dump") or die "Can't open file \ t/svntest1.dump: $!\n"; $inst->restore($infh); This works fine coming from a file, naturally. But say I want to stream a 10Gb file into the restore method. Then I need a handle to pass, so that the restore method doesn't have to have the whole content in memory. Hopefully this explains what I'm after. -- Robin <[EMAIL PROTECTED]> JabberID: <[EMAIL PROTECTED]> Hostes alienigeni me abduxerunt. Qui annus est? PGP Key 0xA99CEB6D = 5957 6D23 8B16 EFAB FEF8 7175 14D3 6485 A99C EB6D
pgpSbLZw0cIlg.pgp
Description: PGP signature