http://www.perlmonks.org?node_id=1004587


in reply to ftp folder creation date

That's not so easy. FTP has two ways of transferring file lists: NLST, which transfers only names (and is used in $ftp->ls) and LIST (which can be got using $ftp->dir), which is human-readable and is not described in RFC. The second one can contain the needed dates, but you can have troubles decoding it. (see the RFC 959 for details)

Use Net::FTP::File to get parsed values from LIST command.

Sorry if my advice was wrong.

Replies are listed 'Best First'.
Re^2: ftp folder creation date
by Anonymous Monk on Nov 20, 2012 at 07:24 UTC

    fstat is listed as a TODO, so not exactly useful

      Tried to connect to my own FTP server using a commandline ftp client, couldn't get anything looking like creation date (only modification date was present) even using STAT command.
      Now I doubt whether this is possible at all.
      Sorry if my advice was wrong.

        Yes, FTP is ugly, in more than one aspect. Things get much worse when the FTP server runs on DOS, Windows or Netware. The "human readable" output often is readable, but far from anything you would expect from an FTP server running on Unix.

        baskar_79, could you connect using SSH and use SFTP instead? SFTP has atime/mtime/ctime, since at least version 4 (dated 2002). As a nice side effect, you get encrypted transfers and you could switch from passwords to public key authentication.

        Alexander

        --
        Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)