in reply to Re: Re: Re: Re: using $ftp->mdtm($file)
in thread using $ftp->mdtm($file)

stewartski,
You can't just comment out code all willy nilly. There is a problem, it told you what the problem is, you need to correct it before moving on. Now I can't guess as to what the problem is because you have not shown all the code, but it sounds like mdtm is on an operating system that does not work correctly or you are not passing it file names the process has permission to query. You will need to show more/all of your code - preferrably in readmore tags. You have me worried when you say $connect is the same as $ftp. Unless you have two concurrent FTP processes going at the exact same time in the same directory you can not interchange them like you did.

Cheers - L~R

  • Comment on Re: Re: Re: Re: Re: using $ftp->mdtm($file)

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Re: using $ftp->mdtm($file)
by stewartski (Initiate) on Feb 26, 2004 at 12:04 UTC
    Thanks L~R - at the risk of sending us both round in circles, I present the entire (short) program (as you suggest in readmore tags): This program runs fine with no error messages, but exits on the first .stm file with the "cannot get mdtm time" message.

    The script is being run from a machine running Linux, although I don't at present know what flavour/version, likewise the remote server the script is 'operating' on.

    Once again I am very grateful for your time and energy.

    Thanks
    stewartski

      stewartski,
      A quick cursory glance at your code doesn't reveal any immediate problem. So now I can only offer you possibilities.
      • See if it behaves the same way on a different server
      • See if it behaves the same way in active mode
      • Change $ftp->ls() to $ftp->dir() and manually parse the time stamp
      • Modify the mdtm sub from Net::FTP and possibly provide a bug fix.

      I will explain the last part now. You want to temporarily change the mdtm sub to the following:

      sub mdtm { my $ftp = shift; my $file = shift; return $ftp->_MDTM($file) || undef; }
      This won't fix anything - this is strictly to see what the stamp looks like. If you can subsequently modify the original code to properly parse it great - send in a patch. If not, post a new SoPW question saying how can I convert "X" into epoch time stamp.

      Cheers - L~R