libssh2_sftp_rmdir_ex(3)

πŸ“¦
version 1.11.1 Β· 3 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, debian trixie, epel 10, epel 9, fedora 43, fedora 44, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– 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 by libssh2_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 args sourcefile and sourcefile_len while the synopsis says path and path_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 the sftp instance 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 βœ¨πŸŽ€