1 .\" $Id: libssh2_sftp_readdir.3,v 1.11 2007/07/04 10:44:40 jehousley Exp $
3 .TH libssh2_sftp_readdir_ex 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
5 libssh2_sftp_readdir_ex - read directory data from an SFTP handle
8 #include <libssh2_sftp.h>
11 libssh2_sftp_readdir_ex(LIBSSH2_SFTP_HANDLE *handle, char *buffer, size_t buffer_maxlen, char *longentry, size_t longentry_maxlen, LIBSSH2_SFTP_ATTRIBUTES *attrs);
14 libssh2_sftp_readdir(LIBSSH2_SFTP_HANDLE *handle, char *buffer, size_t buffer_maxlen, LIBSSH2_SFTP_ATTRIBUTES *attrs);
17 \fIhandle\fP - is the SFTP File Handle as returned by
18 .BR libssh2_sftp_diropen(3)
20 \fIbuffer\fP - is a pointer to a pre-allocated buffer of at least
21 \fIbuffer_maxlen\fP bytes to read data into.
23 \fIbuffer_maxlen\fP - is the length of buffer in bytes. If the length of the
24 filename is longer than the space provided by buffer_maxlen it will be
27 \fIlongentry\fP - is a pointer to a pre-allocated buffer of at least
28 \fIlongentry_maxlen\fP bytes to read data into.
30 \fIlongentry_maxlen\fP - is the length of longentry in bytes. If the length
31 of the full directory entry is longer than the space provided by
32 longentry_maxlen it will be truncated to fit.
34 \fIattrs\fP - is a pointer to LIBSSH2_SFTP_ATTRIBUTES storage to populate
35 statbuf style data into.
37 Read a block of data from a LIBSSH2_SFTP_HANDLE. This method is modeled
40 however, it uses a variable sized directory entry (filename) buffer and
41 returns statbuf type data in the same call.
44 Number of bytes actually populated into buffer, or negative on failure. It returns
45 LIBSSH2_ERROR_EAGAIN when it would otherwise block. While
46 LIBSSH2_ERROR_EAGAIN is a negative number, it isn't really a failure per se.
48 \fILIBSSH2_ERROR_ALLOC\fP - An internal memory allocation call failed.
50 \fILIBSSH2_ERROR_SOCKET_SEND\fP - Unable to send data on socket.
52 \fILIBSSH2_ERROR_SOCKET_TIMEOUT\fP -
54 \fILIBSSH2_ERROR_SFTP_PROTOCOL\fP - An invalid SFTP protocol response was
55 received on the socket, or an SFTP operation caused an errorcode to be
56 returned by the server.
59 .BR libssh2_sftp_opendir(3)
60 .BR libssh2_sftp_closedir(3)