geom_gate userland utility improvements
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

66 lines
2.6 KiB

  1. .TH libssh2_sftp_readdir_ex 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
  2. .SH NAME
  3. libssh2_sftp_readdir_ex - read directory data from an SFTP handle
  4. .SH SYNOPSIS
  5. .nf
  6. #include <libssh2.h>
  7. #include <libssh2_sftp.h>
  8. int
  9. libssh2_sftp_readdir_ex(LIBSSH2_SFTP_HANDLE *handle,
  10. char *buffer, size_t buffer_maxlen,
  11. char *longentry, size_t longentry_maxlen,
  12. LIBSSH2_SFTP_ATTRIBUTES *attrs);
  13. .SH DESCRIPTION
  14. Reads a block of data from a LIBSSH2_SFTP_HANDLE and returns file entry
  15. information for the next entry, if any.
  16. \fIhandle\fP - is the SFTP File Handle as returned by
  17. .BR libssh2_sftp_open_ex(3)
  18. \fIbuffer\fP - is a pointer to a pre-allocated buffer of at least
  19. \fIbuffer_maxlen\fP bytes to read data into.
  20. \fIbuffer_maxlen\fP - is the length of buffer in bytes. If the length of the
  21. filename is longer than the space provided by buffer_maxlen it will be
  22. truncated to fit.
  23. \fIlongentry\fP - is a pointer to a pre-allocated buffer of at least
  24. \fIlongentry_maxlen\fP bytes to read data into. The format of the `longname'
  25. field is unspecified by SFTP protocol. It MUST be suitable for use in the
  26. output of a directory listing command (in fact, the recommended operation for
  27. a directory listing command is to simply display this data).
  28. \fIlongentry_maxlen\fP - is the length of longentry in bytes. If the length of
  29. the full directory entry is longer than the space provided by
  30. \fIlongentry_maxlen\fP it will be truncated to fit.
  31. \fIattrs\fP - is a pointer to LIBSSH2_SFTP_ATTRIBUTES storage to populate
  32. statbuf style data into.
  33. .SH RETURN VALUE
  34. Number of bytes actually populated into buffer (not counting the terminating
  35. zero), or negative on failure. It returns LIBSSH2_ERROR_EAGAIN when it would
  36. otherwise block. While LIBSSH2_ERROR_EAGAIN is a negative number, it isn't
  37. really a failure per se.
  38. .SH BUG
  39. Passing in a too small buffer for 'buffer' or 'longentry' when receiving data
  40. only results in libssh2 1.2.7 or earlier to not copy the entire data amount,
  41. and it is not possible for the application to tell when it happens!
  42. .SH ERRORS
  43. \fILIBSSH2_ERROR_ALLOC\fP - An internal memory allocation call failed.
  44. \fILIBSSH2_ERROR_SOCKET_SEND\fP - Unable to send data on socket.
  45. \fILIBSSH2_ERROR_SOCKET_TIMEOUT\fP -
  46. \fILIBSSH2_ERROR_SFTP_PROTOCOL\fP - An invalid SFTP protocol response was
  47. received on the socket, or an SFTP operation caused an errorcode to be
  48. returned by the server.
  49. From 1.2.8, LIBSSH2_ERROR_BUFFER_TOO_SMALL is returned if any of the
  50. given 'buffer' or 'longentry' buffers are too small to fit the requested
  51. object name.
  52. .SH SEE ALSO
  53. .BR libssh2_sftp_open_ex(3),
  54. .BR libssh2_sftp_close_handle(3)