libssh2_sftp_unlink_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

okay so bestie, welcome to the libssh2 manual, page libssh2_sftp_unlink_ex(3) πŸ’… this one is short and sweet and it's giving "delete that file, bestie" energy πŸ—‘οΈβœ¨


🌸 NAME 🌸

libssh2_sftp_unlink_ex β€” unlink an SFTP file 🫢


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <libssh2.h>
#include <libssh2_sftp.h>

int
libssh2_sftp_unlink_ex(LIBSSH2_SFTP *sftp, const char *filename, unsigned int filename_len);

int
libssh2_sftp_unlink(LIBSSH2_SFTP *sftp, const char *filename);

two icons, one job 😌 the _ex one lets you pass the length yourself, the other one figures it out. slay.


πŸŽ€ DESCRIPTION πŸŽ€

  • sftp β€” the SFTP instance, as returned by libssh2_sftp_init(3) 🌈
  • filename β€” path and name of the existing filesystem entry πŸ“
  • filename_len β€” length of the path and name of the existing filesystem entry πŸ“

and what does it do? it unlinks (deletes) a file from the remote filesystem. that's it. that's the whole vibe. poof, gone, no cap πŸ’€βœ¨

fr fr bestie, "unlink" means delete. once it's gone it's gone, so maybe do a vibe check on that path before you send it πŸ‘€

πŸ’– RETURN VALUE πŸ’–

returns 0 on success, or a negative number on failure 😭 and heads up: 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 just the "not right now, try again later" of it all, iykyk 🫢


πŸ”₯ ERRORS πŸ”₯

  • LIBSSH2_ERROR_ALLOC β€” an internal memory allocation call failed πŸ’€
  • LIBSSH2_ERROR_SOCKET_SEND β€” unable to send data on socket πŸ“‘
  • LIBSSH2_ERROR_SOCKET_TIMEOUT β€” ⏰ (that's the whole note, bestie, the original said nothing more and we don't make things up here βœ‹)
  • 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 🚨

🌈 SEE ALSO 🌈


mwah πŸ’œ this page comes to you from the libssh2 0.15 era, dated 1 Jun 2007 β€” vintage icon behavior, honestly πŸ‘‘ thanks for reading, go delete something responsibly πŸŽ€πŸ¦‹βœ¨