in reply to Re^2: mtime method dropping seconds
in thread mtime method dropping seconds

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.

Replies are listed 'Best First'.
Re^4: mtime method dropping seconds
by Anchor (Novice) on Apr 14, 2010 at 18:10 UTC
    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.
Re^4: mtime method dropping seconds
by Anchor (Novice) on Apr 15, 2010 at 14:17 UTC
    (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!
      I am glad that this Net::FTP idea is working out well for your application!

      The Net::FTP package also has a way to get a list of files. You can use Perl grep{} to get a subset of file to make further queries upon. I don't see the need to mix Win32::Internet and Net::FTP.