Using your script on my Win32 box to connect to an SSH2 server on my linux box, I find that the connection is made without any trouble at all.
However, the 'scp_get' call segfaults, and I get the following error message:
libssh2_scp_recv(ss->session, path, &st) -> 0x2b849a4
If I try an 'scp_put' I get a similar message (and segfault):
libssh2_scp_send_ex(ss->session, path, mode, size, mtime, atime) -> 0x +2b8a0d4
I find that the file I tried to upload with 'scp_get' was created in the correct location on the server ... but is empty :-(
The test script that ships with the Net-SSH2 source, constructs the 'scp_get' call a little differently (though that's not the problem, afaict). It does:
my $check = IO::Scalar->new; $ssh2->scp_get($remote, $check);
I hadn't realised scp wasn't working on Windows. (I failed to notice that, since IO::Scalar was not installed, the scp tests were being skipped.) OTOH, sftp seems to work fine
I'm using Net-SSH2-0.18 on perl-5.10.

Update: Just noticed that 'scp_put' and 'scp_get' both work ok for me on perl-5.8.8, Win32. If you're using Win32, and you really do need scp, then 5.8.8 is probably the simplest way to achieve it.

Cheers,
Rob

In reply to Re^3: ssh2 scp question by syphilis
in thread ssh2 scp question by llass61

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.