Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
my @files=$ftp->ls or die "Cannot list current directory: $@"; foreach my $x_files(@files) { # Tried that but it exits completely and never gets to the next if #next unless ($file_path.$x_files =~ m/\.xml$/); #I am loking for new files only, it works for new files only but ignor +es the rest of the check, has to be a better way here if ((-e $file_path.$x_files ) && (-z $file_path.$x_files > 0) && ($ +file_path.$x_files =~ m/\.xml$/) ) { # Print this just for sanity check! print "File $x_files already exists!<br>"; print "File $x_files has ) size!<br>"; print "File $x_files isn't a xml file!<br>"; }else{ $ftp->get($x_files, "$file_path".$x_files) or die "Can't fetch $x_files: $ +!\n"; push @all_files, "$file_path".$x_files; + } #print "$x_files<br>"; } $ftp->quit;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: File Size Check
by locked_user sundialsvc4 (Abbot) on Mar 28, 2008 at 13:54 UTC | |
|
Re: File Size Check
by cdarke (Prior) on Mar 28, 2008 at 15:48 UTC | |
by tinita (Parson) on Mar 29, 2008 at 10:51 UTC | |
|
Re: File Size Check
by Anonymous Monk on Mar 28, 2008 at 13:03 UTC |