Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Re: ftp folder creation date

by aitap (Curate)
on Nov 19, 2012 at 17:30 UTC ( #1004587=note: print w/replies, xml ) Need Help??

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.


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

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1004587]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2018-03-22 06:27 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (273 votes). Check out past polls.