in reply to mtime method dropping seconds

I don't know what CheckDTS() does. What happens if you just print the name and mtime?:
my @files = $ftp->List("*.*", 3); foreach my $file (@files) { print $file->{'name'}, " ", $file->{'mtime'}, "\n"; }

Replies are listed 'Best First'.
Re^2: mtime method dropping seconds
by Anchor (Novice) on Apr 13, 2010 at 14:28 UTC
    Thanks for the reply.

    I put in the print statement and ran the program. I had one file on the FTP server with a date/time of 4/9/2010 4:35:13 (EST) and this gets printed out: 0,35,20,9,4,2010

    I understand the 20 for the hours is there because its getting the date/time in GMT but I don't know why the seconds is zero. Its weird.
      This is pretty weird. Instead of using Win32::Internet, perhaps Net::FTP will give better results? This is available as an Active State module if you are using that flavor of Windows Perl. The basic idea is the same but the method names are a bit different. $ftp->mdtm ( FILE )...Returns the modification time of the given file.

      Other thoughts, ftp is a standard program on Win XP. At the command prompt, type "FTP" and hack around with that to get connected and list the remote directory. If that can show the seconds info from that server, then it is very likely that some Perl module can do it to. If not, then I am out of ideas for the moment.

      Well I guess one more FTP way is to use the FireFTP plugin to Firefox. I use it exclusively for my interactive FTP needs nowadays (instead of the command line). It is an impressive add-on.

      Update: I just logged into one SFTP site and there aren't any seconds, minutes is all I get. So, it may very well be that that's all that there is! I see a post from roboticus about this.

        I tried the Net::FTP and its mdtm method does give me the seconds. (Nice!) However, if I use this package I lose the ability to filter files according to a file pattern that you can pass into the Win32::Internet's "List" method. (Damn!)

        So, one thing that might work is getting the list of files using the Win32::Internet module and then, once I have the list of files, use the Net::FTP module to log on to the FTP site (again) and check the date/time using the "mdtm" method. It's a hack but it should work.
        (I thought I sent this but I guess I didn't so let me try again.)

        I tried the Net::FTP package and the mdtm method and that did return the seconds. But, if I use the Net::FTP package I would lose my ability to get a list of files that match a file name pattern, like you can do with the Win32::Internet package's List method.

        What I could do is still use the Win32::Internet List method to get the list of files but then use the Net::FTP package to log on to the FTP server (again) and use the mdtm method to get the modification time with the seconds, passing in the file name. Its kind of a hack but it should work.

        Thanks again for the help!