how to use rdir in Net Ftp recursive

R

romieuc

Hi everybody

I managed to use quite easily rget but i cannot with rdir
would anyone have an example?
 
S

Sisyphus

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
 
K

kunlun

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 écrit :
 
S

Sisyphus

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,434
Messages
2,571,685
Members
48,796
Latest member
Greg L.

Latest Threads

Top