Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hi,
I need to fetch certain files from the server which has multiple subdirectories. How do i do it with NET FTP in Perl.
Example : \home\code\test and home\code\prod I need to search for files under code (the file may be present in 'test' or 'prod') and get that file to local.
The code I used - my $dir = "/home/code"; $f->cwd($dir) or die "Can't cwd to $dir\n"; $, = "\n"; my $fileto_get = "sample.sh"; $f->get($fileto_get) or die "Can't get $fileto_get from $dir\n";
This searches only in the specified directory 'code'. The file is present in 'tes't directory but it is not returned unless i change the directory to "/home/code/test".
Please guide me on how to fetch files, by mentioning only the parent directory.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Net :: FTP
by cheekuperl (Monk) on Sep 04, 2012 at 05:04 UTC | |
by Anonymous Monk on Sep 04, 2012 at 06:31 UTC | |
by cheekuperl (Monk) on Sep 04, 2012 at 07:39 UTC | |
by Anonymous Monk on Sep 04, 2012 at 09:03 UTC | |
by Anonymous Monk on Sep 04, 2012 at 09:05 UTC | |
by cheekuperl (Monk) on Sep 04, 2012 at 15:06 UTC | |
by Anonymous Monk on Sep 04, 2012 at 06:29 UTC | |
Re: Net :: FTP
by aitap (Curate) on Sep 04, 2012 at 18:53 UTC |
Back to
Seekers of Perl Wisdom