Is there a perl method for retrieving the create date of remote files via FTP?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • AlfredE
    New Member
    • Jan 2010
    • 3

    Is there a perl method for retrieving the create date of remote files via FTP?

    The perl::ftp's mdtm method returns the last mod date of a specified remote file. We've found that on our sftp server, the last mod date is often earlier than the date and time the file is actually received. We need to record the date received, but what we are getting is (i believe) the file's creation date on some remote server. What we want is the date and time the file is placed on our server.

    Here's the current syntax used:
    my $FtpGMTimeInt = $FTP->mdtm($FtpFromF ile);

    Any suggestions?
  • RonB
    Recognized Expert Contributor
    • Jun 2009
    • 589

    #2
    What is the OS of the FTP server?

    There are 3 timestamps ctime, mtime, and atime which loosly means
    ctime = creation
    mtime = modification
    atime = access

    However, *nix servers don't actually maintain the file creation timestamp. The ctime on *nix servers is the timestamp when the inode was last updated. Changing file permissions or ownership will change the ctime.

    The mtime is the timestamp when the contents/data in the file was last changed.

    Comment

    • AlfredE
      New Member
      • Jan 2010
      • 3

      #3
      Followup question

      Hi Bob,
      First thanks for getting back to me. I do understand the 3 dates available. What is as yet unclear is whether any ftp command will allow me to retrieve the 'cdate' instead of the mdate.
      Also, I'm assuming a '*nix' server is shorthand for unix, linux, posix, etc.

      Regards,
      AlfredE

      Comment

      • AlfredE
        New Member
        • Jan 2010
        • 3

        #4
        Oh yes, the operating system

        I believe it is an NT server, but I am unsure. We use both in our environment.

        Comment

        Working...