> Howdy group,
>
> Any body have any suggestions on the best way to copy a file
> with Net::FTP?
>
> I don't want to simply rename() a file as I want to keep the
> existing one and create a new file that is the same.
>
> I know how to use stor() to use content in variables:
>
> my $stor = $ftp->stor("copyoforig.txt");
> $stor->write($fileguts, length($fileguts)); $stor->close();
>
> My question would be how would I use retr() to get 'orig.txt'
> into the variable $fileguts?
>
> Would I simply do: $fileguts = $ftp->retr('orig.txt');
Am I thinking about the way dataconn class functions (IE retr and stor) work right: ?
my $fileguts;
my $size = $ftp->size('orig.txt');
my $retr = $ftp->retr('orig.txt');
$retr->read($fileguts, $size);
$retr->close();
my $stor = $ftp->stor("copyoforig.txt");
$stor->write($fileguts, length($fileguts));
$stor->close();
That would grab the orig.txt contents then write it back to the server it just got it
from as copyoforig.txt?
Right?
I think that should do it, I juet need reassurance I'm not crazy!!
Thanks
Dan
>
> TIA all you wonderfull Perl folks!
>
> Dan
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]