poori has asked for the wisdom of the Perl Monks concerning the following question:
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: net ftp recursive - rls and rdir
by Lotus1 (Vicar) on Sep 07, 2012 at 13:01 UTC | |
|
Re: net ftp recursive - rls and rdir
by Mr. Muskrat (Canon) on Sep 07, 2012 at 13:52 UTC | |
|
Re: net ftp recursive - rls and rdir
by philiprbrenan (Monk) on Sep 07, 2012 at 13:24 UTC | |
|
Re: net ftp recursive - rls and rdir
by poori (Initiate) on Sep 10, 2012 at 07:25 UTC | |
by Lotus1 (Vicar) on Sep 10, 2012 at 14:23 UTC | |
by Anonymous Monk on Sep 11, 2012 at 03:10 UTC | |
by poori (Initiate) on Sep 11, 2012 at 07:01 UTC |