in reply to Net::SFTP::Foreign Puzzle

my $check_path = $remoteh->do_opendir( $target_root . '/' . $remote_di +r ); Couldn't get handle: Failure at ./image_upload.pl line 77

Wild guess: are you closing the opened filehandles?

--
David Serrano

Replies are listed 'Best First'.
Re^2: Net::SFTP::Foreign Puzzle
by SheridanCat (Pilgrim) on Jul 06, 2006 at 16:35 UTC
    Exactly right. I made this change:
    my $check_path = $remoteh->do_opendir( $target_root . '/' . $remote_di +r ); if( ! $check_path ){ $remoteh->do_mkdir( $target_root . '/' . $remote_dir, Net::SFTP::For +eign::Attributes->new() ); }else{ $remoteh->do_close( $check_path ); }
    Now all is well. Thank you so much for pointing that out. Very dumb of me.

      You are still leaving opened filehandles, the ones for which !$check_path is true. I would close the filehandles unconditionally just after the $remoteh->put line.

      --
      David Serrano

        Ack, thanks David, I'll fix that.