libssh2_sftp_rmdir_ex(3)
π libssh2_sftp_rmdir_ex(3) β the libssh2 girlies' guide to yeeting a remote directory π
okay so bestie, welcome to the libssh2 manual, and today's main character is libssh2_sftp_rmdir_ex β the function that says "this folder? gone. not here. never was." β¨
πΈ NAME πΈ
libssh2_sftp_rmdir_ex β remove an SFTP directory ποΈ
β¨ SYNOPSIS β¨
#include <libssh2.h>
#include <libssh2_sftp.h>
int
libssh2_sftp_rmdir_ex(LIBSSH2_SFTP *sftp, const char *path,
unsigned int path_len);
like. look at her. three args, one int, zero drama (until the error codes show up π).
π¦ DESCRIPTION π¦
Remove a directory from the remote file system. that's it, that's the whole vibe β remote directory? deleted. slay. π
sftpβ the SFTP instance, as returned bylibssh2_sftp_init(3). your lil connection baby π«Άsourcefileβ Full path of the existing directory to remove. full path only, no shortcuts, she's specific like that.sourcefile_lenβ Length of the full path of the existing directory to remove. yes you have to count it yourself, it's giving old school π
not me noticing the description calls the argssourcefileandsourcefile_lenwhile the synopsis sayspathandpath_lenπ both names are real, keep them straight, iykyk.
π RETURN VALUE π
Return 0 on success, or negative on failure. simple math, no cap.
It returns LIBSSH2_ERROR_EAGAIN when it would otherwise block. and like β yes, LIBSSH2_ERROR_EAGAIN is a negative number, but it's not really a failure per se. it's the "bestie i'm busy, come back in a sec" of return codes π« don't panic, just try again.
π ERRORS π
LIBSSH2_ERROR_ALLOCβ An internal memory allocation call failed. the malloc said no πLIBSSH2_ERROR_SOCKET_SENDβ Unable to send data on socket. the socket is not picking up the phone π΅LIBSSH2_ERROR_SOCKET_TIMEOUTβ (no description given, she's mysterious like that) β³LIBSSH2_ERROR_SFTP_PROTOCOLβ An invalid SFTP protocol response was received on the socket, or an SFTP operation caused an errorcode to be returned by the server. translation: either the reply was nonsense, or the server sent back an error code and honestly? rude π₯
π SEE ALSO π
libssh2_sftp_init(3)β go meet the function that makes thesftpinstance in the first place, she's the plug π
and that's the whole page bestie, every option, every error, every word β nothing skipped, nothing invented, periodt. π
this was brought to you by libssh2 0.15, dated 1 Jun 2007, and the page you just read is libssh2_sftp_rmdir_ex(3) β vintage but iconic, she's been slaying since '07 β¨π
π¦ 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