libssh2_scp_recv(3)
π libssh2_scp_recv β like, the SCP file grabber (from the libssh2 manual, bestie) π
β¨ NAME β¨
libssh2_scp_recv β bestie, this is how you request a remote file via SCP π¦
πΈ SYNOPSIS πΈ
#include <libssh2.h>
LIBSSH2_CHANNEL *
libssh2_scp_recv(LIBSSH2_SESSION *session, const char *path, struct stat *sb);
π DESCRIPTION π
ok so first things first, no cap: this function is DEPRECATED in 1.7.0. Use the libssh2_scp_recv2(3) function instead! π¨ like, fr fr, go use the other one, this one is giving legacy energy π
Now the deets on the arguments, because you deserve to know:
sessionβ the Session instance, aka the thing you got back fromlibssh2_session_init_ex(3)π«Άpathβ the full path and filename of the file you wanna transfer. That's the remote file name, bestie, not your local one β¨sbβ gets populated with the remote file'ssize,mode,mtime, andatimeπ
And what does it actually do? It requests a file from the remote host via SCP. That's it, that's the whole vibe. π
π RETURN VALUE π
You get a pointer to a newly allocated LIBSSH2_CHANNEL instance. Iconic. But if things go sideways you get NULL on errors π
π ERRORS π
LIBSSH2_ERROR_ALLOCβ an internal memory allocation call failed. Not the moment, bestie πLIBSSH2_ERROR_SCP_PROTOCOLβ (the original page just lists it here with nothing else, so we're keeping it mysterious like that π)LIBSSH2_ERROR_EAGAINβ this one's marked for non-blocking I/O but the call would block. So like, try again later, periodt β
π¦ SEE ALSO π¦
and that's the whole page, bestie!! this was libssh2 version 0.15, dated 1 Jun 2007 β yes, an elder, but still serving πΈ go forth and libssh2_scp_recv2(3) instead, mwah ππ
π¦ where this page comes from
- alpine 3.22: libssh2-doc 1.11.1-r3 Β· BSD-3-Clause
- alpine 3.23: libssh2-doc 1.11.1-r4 Β· BSD-3-Clause
- alpine 3.24: libssh2-doc 1.11.1-r4 Β· BSD-3-Clause
- arch rolling: libssh2 1.11.1-7 Β· BSD-3-Clause
- debian trixie: libssh2-1-dev 1.11.1-1+deb13u1 Β· BSD3
- debian trixie: libssh2-1-dev 1.11.1-1+deb13u2 Β· BSD3
- epel 10: libssh2-docs 1.11.1-9.el10_3 Β· BSD-3-Clause
- epel 9: libssh2-docs 1.11.1-9.el9 Β· BSD-3-Clause
- fedora 43: libssh2-docs 1.11.1-4.fc43 Β· BSD-3-Clause
- fedora 43: libssh2-docs 1.11.1-9.fc43 Β· BSD-3-Clause
- fedora 44: libssh2-docs 1.11.1-5.fc44 Β· BSD-3-Clause
- fedora 44: libssh2-docs 1.11.1-9.fc44 Β· BSD-3-Clause
- opensuse-leap 16.0: libssh2-devel 1.11.1-160000.5.1 Β· BSD-3-Clause
- opensuse-leap 16.0: libssh2-devel 1.11.1-160000.5.1 Β· BSD-3-Clause
- opensuse-leap 16.0: libssh2-devel 1.11.1-160000.5.1 Β· BSD-3-Clause
- opensuse-leap 16.0: libssh2-devel 1.11.1-160000.5.1 Β· BSD-3-Clause
- ubuntu questing: libssh2-1-dev 1.11.1-1build1
- ubuntu questing: libssh2-1-dev 1.11.1-1ubuntu0.25.10.2
- ubuntu resolute: libssh2-1-dev 1.11.1-1build2 Β· BSD3
- ubuntu resolute: libssh2-1-dev 1.11.1-1ubuntu0.26.04.4 Β· BSD3
- ubuntu stonking: libssh2-1-dev 1.11.1-6 Β· BSD3
- π the page's license: BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms