Hi Monks,
I need to get a list of files present in a directory on a remote server through ftp. I need the list of all the files inside the directory I specify ( files in the subdirectories as well).
So i used a NET FTP Recursive for this. I need to use the rls method. but I keep getting the error about using a filehandle. Can anyone please explain with an example on how to use the rls method.
This is my code snippetuse strict; use warnings; use Net::FTP; use Net::FTP::Recursive; use FileHandle; # after providing the host and user details my $fh = new FileHandle; my $dir = "/home/prod/game/code"; $f->cwd($dir) or die "Can't cwd to $dir\n"; $, = "\n"; select $fh; #Now when i write the rls like this my @files = $f->rls(Filehandle => $fh) or die "??"; #i'm getting a timed out error even for lesser number of files #Now when i write the rls like this w/o declaring any file handler my @files = $f->rls() or die "??"; # i get the error -You must pass a filehandle when using rdelete/rls!
Please help.
In reply to net ftp recursive - rls and rdir by poori
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |