Hi,
        When I try to retrieve the timestamp from a ftp folder I get 
        this error message :
           >> Can't call method "mtime" on an undefined value at func.pl
line 69

        but the same works in my local machine.

        My motive is to read the timestamp for each files in the remote
folder.

        Can somebody point out what is wrong exactly or any alternative
??

 Please help  !!

~Alok

{
    my ($host, $ftpDir) = @_;
    my $user = "ftp";
    my $pass = "";

    my $ftp = Net::FTP->new($host) or die "Could not ftp to host: $host:
[EMAIL PROTECTED]";
    $ftp->login($user, $pass) or die "Could not login as $user/$pass\n";
    $ftp->binary;
    $ftp->hash;

    # Show the ftp directory contents and the timestamp
    foreach ($ftp->ls($ftpDir)) {
        print "file =  $_\n"  ;

        $file_date = ctime(stat($_)->mtime);
        print "file $file updated at $file_date\n";
        }
}

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to