Re: Finding out the time on an FTP server using perl



amit.postbox@xxxxxxxxx writes:

> Hello,
>
> Does anybody know how to find out the local time (and the timezone) on
> a remote FTP server using perl?

I'm not aware of anything in the FTP protocol that allows that
directly. A few ideas:

* If you control the FTP server, you could also run a time server on
it you could query.

* If you can create a file on the FTP server, you can create it and
immediately ask for the modification time, which will be a good
approximation.

* You could see if there are any other services on the same server
that provide a timestamp, like HTTP.

Also, if you post the problem you're trying to solve, there might be a
way to do it without knowing the current time. For example, if you
want to see if a file has changed since last time you checked, you can
store the modification time of the file, and see if it's newer than
that. If you want to see if a file is still being modified, get the
modification time, sleep for 5 minutes, get it again, and see if it's
changed.

-----Scott.
.



Relevant Pages

  • Re: perl ftp and hidden partitions
    ... I have an automation problem with perl and a ftp server. ... for data logging. ... implies that it will cause the client to issue the FTP command ...
    (comp.lang.perl.misc)
  • Re: chmod files on ISPs server
    ... > Is there a general way, using perl, to change the permissions of my cgi ... That depends on which ftp server your ISP uses. ... > found a way to alter them using perl or any other means. ...
    (comp.lang.perl.misc)
  • perl ftp and hidden partitions
    ... I have an automation problem with perl and a ftp server. ... The files will be on a hidden partition called "F". ...
    (comp.lang.perl.misc)
  • [PHP] FTP issues
    ... The following issues are not really PHP issues, but more properly FTP server issues, but perhaps people on the list have some ideas on how to solve my problems. ... The remote FTP server is running on a Fedora LINUX system, but I think any server would present the same issues. ... I use ftp_rawlistto get a directory listing which I parse. ...
    (php.general)
  • RE: Help writing a back up script
    ... I have constructed similar functionality recently using a combination of CoreFTP and a perl wrapper to handle some of the more complex logic. ... Help writing a back up script ... > logs in to the ftp,deletes a a file in the ftp server ...
    (Security-Basics)