libssh2_scp_send64(3)
π libssh2_scp_send64 β bestie edition π
okay so this is a page from the libssh2 manual, section 3 (library functions, iykyk), and it's all about yeeting a whole file at a remote host over SCP. no cap, it's giving main character energy. let's get into it π«Ά
β¨ NAME β¨
libssh2_scp_send64 β Send a file via SCP
like. literally that's the whole vibe. send a file. via SCP. iconic π
πΈ SYNOPSIS πΈ
#include <libssh2.h>
LIBSSH2_CHANNEL *
libssh2_scp_send64(LIBSSH2_SESSION *session, const char *path, int mode,
libssh2_uint64_t size, time_t mtime, time_t atime);
yes she takes six arguments, she's high maintenance and she deserves it π
π¦ DESCRIPTION π¦
sessionβ the Session instance, aka the one you got back fromlibssh2_session_init_ex(3). your whole connection lives in there.pathβ Full path and filename of the file you're transferring to. bestie, that's the remote file name. the one on the other side of the wire. don't get it twisted πmodeβ File access mode to create the file with.sizeβ Size of the file being transmitted (Must be known ahead of time). and listen, this one's important: it needs to be passed in as variable typelibssh2_uint64_t. That type is 64 bit on modern operating systems and compilers. she's thicc. she's built different. πͺmtimeβ mtime to assign to the file being created.atimeβ atime to assign to the file being created. (Set this andmtimeto zero to instruct the remote host to use the current time. cute little shortcut, slay β)
and that's it. that's the function. Send a file to the remote host via SCP. periodt. π
π RETURN VALUE π
Pointer to a newly allocated LIBSSH2_CHANNEL instance. or NULL on errors π
so like, check your pointers, bestie. always check your pointers.
π ERRORS π
LIBSSH2_ERROR_ALLOCβ An internal memory allocation call failed. the malloc girlies are crying.LIBSSH2_ERROR_SOCKET_SENDβ Unable to send data on socket. the socket said no πLIBSSH2_ERROR_SCP_PROTOCOLβ (no extra detail given, she's mysterious like that π)LIBSSH2_ERROR_EAGAINβ Marked for non-blocking I/O but the call would block. not an L, just a "come back later" π
π AVAILABILITY π
This function was added in libssh2 1.2.6 and is meant to replace the former libssh2_scp_send_ex(3) function. out with the old, in with the new, glow-up complete β¨
π₯ SEE ALSO π₯
go read that one next, bestie, it's the whole prequel π«Ά
lowkey reminder:sizemust be known ahead of time, and it must belibssh2_uint64_t. no guessing. the remote host is counting on you. π
okay that's the whole page, mwah π this was libssh2 1.2.6, dated 17 Apr 2010 β yes she's vintage, she's a classic, she ate and left no crumbs πβ¨ bye bestie, go send some files ππ¦πΈ
π¦ 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