Hello, I have been working on a program to download files through Net::FTPSSL and finally got that part working. The next part of the program is to unzip the file and do some processing. The issue I have come across is that I cannot do a file test to ensure the file is there or stat the file. I get that it is not found, but it does exist. Any ideas why this would occur? Below is part of the code and where it occurs at.
my @remote_files = $ftp->nlst(); my @get_files; print "The current date is $month $day $year\n" if $DEBUG eq 'yes' +; foreach $file (@remote_files) { chomp($file); if ($file =~ /O$year\_$month\_$day/ ) { push @get_files, $file; print "Remote file matches needed file date $file\n" if ($ +DEBUG eq 'yes'); } } my $new_file; foreach $new_file (@get_files) { &ftp_files($new_file, $ftp); chomp($new_file); print "zip_file $ccp_home/$new_file\n" if $DEBUG eq 'yes'; if ( -e "$ccp_home/$new_file" ) { print "unzipping $ccp_home/$new_file\n" if $DEBUG eq 'yes' +; system("/usr/bin/unzip -q $ccp_home/$new_file"); $month = &fix_date($month); $year -= 2000; $year = &fix_date($year); $day = &fix_date($day); } else { print "File for unzipping not found: $ccp_home/$new_file\n +" if $DEBUG eq 'yes'; }
Thanks

In reply to 5.8.8 stat and file test fails by emwdrich

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.