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

I found this useful. Thank you. I'm now trying to just extract the modified files *not* directories. Any insight I'd be grateful as

 (-f $entry->{a} )

does not work.

Replies are listed 'Best First'.
Re^3: How to execute stat command in remote server
by salva (Canon) on Nov 26, 2013 at 10:20 UTC
Re^3: How to execute stat command in remote server
by Anonymous Monk on Nov 26, 2013 at 07:36 UTC
    sure it does

      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} ) ) } );