in reply to Re^2: How to execute stat command in remote server
in thread How to execute stat command in remote server

sure it does
  • Comment on Re^3: How to execute stat command in remote server

Replies are listed 'Best First'.
Re^4: How to execute stat command in remote server
by dpath2o (Acolyte) on Nov 26, 2013 at 22:20 UTC

    Really? Here's my code and I get no return results with it, but if I remove ( -f $entry->{a} ) I get the files and the directories ... I guess I could add regex condition as well, but I'd rather not

    use Net::SFTP::Foreign; my $hostname='my.server.com'; my $sftp = Net::SFTP::Foreign->new( $hostname , user=>"me" ); my @files = $sftp->find( '/data/dir',wanted => sub{ my $now = time(); my $yesterday = $now-(24*3600); my (undef, $entry) = @_; ( ($entry->{a}->mtime < $now) and ($entry->{a}->mti +me > $yesterday) and (-f $entry->{a} ) ) } );