Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

ftp folder creation date

by baskar_79 (Initiate)
on Nov 19, 2012 at 13:46 UTC ( #1004541=perlquestion: print w/replies, xml ) Need Help??
baskar_79 has asked for the wisdom of the Perl Monks concerning the following question:

Hi All, I am trying to get the list of directory from the ftp with its creation date. But, i can get the directory list using Net::FTP, as $ftp->ls(), but i need help on getting the creation date of the folder. Please help me on this. Regards Baskar

Replies are listed 'Best First'.
Re: ftp folder creation date
by aitap (Curate) on Nov 19, 2012 at 17:30 UTC

    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.

      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.
Re: ftp folder creation date
by Anonymous Monk on Nov 19, 2012 at 14:27 UTC

    Please help me on this.

    How do you think we can help, what do you think we can do?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1004541]
Approved by marto
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2018-06-20 06:35 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (116 votes). Check out past polls.