Bettan has asked for the wisdom of the Perl Monks concerning the following question:
Would be greatful if someone can help me. This worked out with Net::FTP Thanks in advance Bettan# GET FILE LIST if ( !$error_flag ) { if ( !$debug ) { @files = $ftp->list() or $error_flag = + 1; $ftp->quit if $error_flag; } else { opendir( DIR, "$debug_ftp_directory/$d +irectory_local" ) or $error_flag = 1; @files = readdir(DIR); closedir(DIR); } $report = $report . " ERROR: Can't get file l +ist $!\n" if $error_flag; $error_cnt++ if $error_flag; } # GET ALL FILES (*.enc) TO LOCAL DIRECTORY, DELETE THE +M ON SERVER foreach $file (@files) { if ( !$error_flag && $file =~ m/\.enc$/ ) { $report = $report . " Retrieving file + $file\n"; if ( !$debug ) { $ftp->get($file) or $error_fla +g = 1; $ftp->quit if $error_flag; $ftp->delete($file) or $error_ +flag = 1; $ftp->quit if $error_flag; } else { move( "$debug_ftp_directory/$d +irectory_local/$file", '.' ) or $error_flag = 1; } if ( !$error_flag ) { $downloaded_cnt++; } else { $report = $report . " ERROR: Can't re +trieve file $file $!\n"; $error_cnt++; } } } if ( ( !$error_flag ) && ( !$debug ) ) { $ftp->quit; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: FTPSSL Bad file number
by Anonymous Monk on Mar 03, 2015 at 15:23 UTC | |
by Bettan (Initiate) on Mar 04, 2015 at 20:04 UTC | |
by Anonymous Monk on Mar 04, 2015 at 20:17 UTC | |
by Bettan (Initiate) on Mar 05, 2015 at 07:54 UTC | |
by hippo (Archbishop) on Mar 05, 2015 at 09:33 UTC | |
| |
by afoken (Chancellor) on Mar 05, 2015 at 09:37 UTC | |
|
Re: FTPSSL Bad file number
by Anonymous Monk on Mar 03, 2015 at 17:32 UTC |