Home > Archive > PERL Miscellaneous > December 2006 > how to use rdir in Net Ftp recursive
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
how to use rdir in Net Ftp recursive
|
|
| romieuc@free.fr 2006-12-21, 4:02 am |
| Hi everybody
I managed to use quite easily rget but i cannot with rdir
would anyone have an example?
| |
| Sisyphus 2006-12-21, 8:03 am |
|
<romieuc@free.fr> wrote in message
news:1166691500.493008.274890@a3g2000cwd.googlegroups.com...
> Hi everybody
>
> I managed to use quite easily rget but i cannot with rdir
> would anyone have an example?
>
For me, the relevant snippet is simply:
..
..
open($wr, '>', 'rec.txt') or die "Can't open rec.txt for writing: $!";
$ftp->rdir(Filehandle => $wr); # $ftp is a Net::FTP::Recursive object
close($wr) or die "Can't close rec.txt: $!";
..
..
The directory listing for the server's cwd is then written to both 'rec.txt'
and stdout.
Cheers,
Rob
| |
| kunlun 2006-12-21, 8:03 am |
| You 're right
I managed
my pb was the $wr where i was systematically forgotting to pass it as a
variable (with $) ...
thank you
Sisyphus a =E9crit :
> <romieuc@free.fr> wrote in message
> news:1166691500.493008.274890@a3g2000cwd.googlegroups.com...
>
> For me, the relevant snippet is simply:
>
> .
> .
> open($wr, '>', 'rec.txt') or die "Can't open rec.txt for writing: $!";
> $ftp->rdir(Filehandle =3D> $wr); # $ftp is a Net::FTP::Recursive object
> close($wr) or die "Can't close rec.txt: $!";
> .
> .
>
> The directory listing for the server's cwd is then written to both 'rec.t=
xt'
> and stdout.
>=20
> Cheers,
> Rob
| |
| Sisyphus 2006-12-21, 7:02 pm |
|
"kunlun" <romieuc@free.fr> wrote in message
news:1166705621.249976.203980@48g2000cwx.googlegroups.com...
You 're right
I managed
my pb was the $wr where i was systematically forgotting to pass it as a
variable (with $) ...
-----------------------------------------------
You could also code it as:
open(WR, '>', 'rec.txt') or die "Can't open rec.txt for writing: $!";
$ftp->rdir(Filehandle => \*WR);
Cheers,
Rob
|
|
|
|
|