1libssh2_sftp_readdir_ex(3) libssh2 manual libssh2_sftp_readdir_ex(3)
2
3
4
6 libssh2_sftp_readdir_ex - read directory data from an SFTP handle
7
9 #include <libssh2.h> #include <libssh2_sftp.h>
10
11 int libssh2_sftp_readdir_ex(LIBSSH2_SFTP_HANDLE *handle, char *buffer,
12 size_t buffer_maxlen, char *longentry, size_t longentry_maxlen, LIB‐
13 SSH2_SFTP_ATTRIBUTES *attrs);
14
15 int libssh2_sftp_readdir(LIBSSH2_SFTP_HANDLE *handle, char *buffer,
16 size_t buffer_maxlen, LIBSSH2_SFTP_ATTRIBUTES *attrs);
17
18
20 handle - is the SFTP File Handle as returned by libssh2_sftp_diropen(3)
21
22 buffer - is a pointer to a pre-allocated buffer of at least buf‐
23 fer_maxlen bytes to read data into.
24
25 buffer_maxlen - is the length of buffer in bytes. If the length of the
26 filename is longer than the space provided by buffer_maxlen it will be
27 truncated to fit.
28
29 longentry - is a pointer to a pre-allocated buffer of at least longen‐
30 try_maxlen bytes to read data into.
31
32 longentry_maxlen - is the length of longentry in bytes. If the length
33 of the full directory entry is longer than the space provided by lon‐
34 gentry_maxlen it will be truncated to fit.
35
36 attrs - is a pointer to LIBSSH2_SFTP_ATTRIBUTES storage to populate
37 statbuf style data into.
38
39 Read a block of data from a LIBSSH2_SFTP_HANDLE. This method is modeled
40 after the POSIX readdir(2) however, it uses a variable sized directory
41 entry (filename) buffer and returns statbuf type data in the same call.
42
43
45 Number of bytes actually populated into buffer, or negative on failure.
46 It returns LIBSSH2_ERROR_EAGAIN when it would otherwise block. While
47 LIBSSH2_ERROR_EAGAIN is a negative number, it isn't really a failure
48 per se.
49
51 LIBSSH2_ERROR_ALLOC - An internal memory allocation call failed.
52
53 LIBSSH2_ERROR_SOCKET_SEND - Unable to send data on socket.
54
55 LIBSSH2_ERROR_SOCKET_TIMEOUT -
56
57 LIBSSH2_ERROR_SFTP_PROTOCOL - An invalid SFTP protocol response was
58 received on the socket, or an SFTP operation caused an errorcode to be
59 returned by the server.
60
61
63 libssh2_sftp_opendir(3) libssh2_sftp_closedir(3)
64
65
66
67libssh2 0.15 1 Jun 2007 libssh2_sftp_readdir_ex(3)