libssh2_scp_recv2(3)
π libssh2_scp_recv2 β bestie edition π
okay so this one is a libssh2 manual page, and it's literally the glow-up version of grabbing a file off a remote host over SCP β¨
πΈ NAME πΈ
libssh2_scp_recv2 β request a remote file via SCP π«Ά
β¨ SYNOPSIS β¨
#include <libssh2.h>
LIBSSH2_CHANNEL *
libssh2_scp_recv2(LIBSSH2_SESSION *session, const char *path, struct_stat *sb);
π DESCRIPTION π
no cap, this is the whole vibe right here. three things go in, one channel comes out π
sessionβ the Session instance, and you get it fromlibssh2_session_init_ex(3). yes, that exact one. it's giving "you already know her" πpathβ Full path and filename of file to transfer. That is the remote file name. so like, the whole journey to the file on the other machine, not yours π¦sbβ Populated with remote file's size, mode, mtime, and atime. she gets filled in for you β size, mode, mtime, atime, the whole lil info dump π¦
and then the actual thing: Request a file from the remote host via SCP. that's it, that's the job, and she eats every time π
π RETURN VALUE π
you get back a Pointer to a newly allocated LIBSSH2_CHANNEL instance. fresh, brand new, main character energy π
or NULL on errors. which is the sad path. we don't love the sad path π
π ERRORS π
okay so when things go wrong, they go wrong in one of these specific ways:
LIBSSH2_ERROR_ALLOCβ An internal memory allocation call failed. the malloc said no ma'am πLIBSSH2_ERROR_SCP_PROTOCOLβ no extra notes on this one, it's just... the protocol being protocol. shrug πLIBSSH2_ERROR_EAGAINβ Marked for non-blocking I/O but the call would block. so like, she's not gonna wait around for you β try again later, bestie π«Ά
β SEE ALSO β
go read those too, iykyk πβ¨
and that's the page, bestie!! this one's from the libssh2 manual, version 1.6.1, dated 29 Jun 2015 β so she's a lil vintage but she still slays πππ¦
π¦ 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