Building the libssh2 and including a script to build it as UB
[printdrop.git] / libssh2 / share / man / man3 / libssh2_sftp_readdir.3
1 .\" $Id: libssh2_sftp_readdir.3,v 1.11 2007/07/04 10:44:40 jehousley Exp $
2 .\"
3 .TH libssh2_sftp_readdir_ex 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
4 .SH NAME
5 libssh2_sftp_readdir_ex - read directory data from an SFTP handle
6 .SH SYNOPSIS
7 #include <libssh2.h>
8 #include <libssh2_sftp.h>
9
10 int
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);
12
13 int
14 libssh2_sftp_readdir(LIBSSH2_SFTP_HANDLE *handle, char *buffer, size_t buffer_maxlen, LIBSSH2_SFTP_ATTRIBUTES *attrs);
15
16 .SH DESCRIPTION
17 \fIhandle\fP - is the SFTP File Handle as returned by
18 .BR libssh2_sftp_diropen(3)
19
20 \fIbuffer\fP - is a pointer to a pre-allocated buffer of at least
21 \fIbuffer_maxlen\fP bytes to read data into.
22
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
25 truncated to fit.
26
27 \fIlongentry\fP - is a pointer to a pre-allocated buffer of at least
28 \fIlongentry_maxlen\fP bytes to read data into.
29
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.
33
34 \fIattrs\fP - is a pointer to LIBSSH2_SFTP_ATTRIBUTES storage to populate
35 statbuf style data into.
36
37 Read a block of data from a LIBSSH2_SFTP_HANDLE. This method is modeled
38 after the POSIX
39 .BR readdir(2)
40 however, it uses a variable sized directory entry (filename) buffer and
41 returns statbuf type data in the same call.
42
43 .SH RETURN VALUE
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.
47 .SH ERRORS
48 \fILIBSSH2_ERROR_ALLOC\fP - An internal memory allocation call failed.
49
50 \fILIBSSH2_ERROR_SOCKET_SEND\fP - Unable to send data on socket.
51
52 \fILIBSSH2_ERROR_SOCKET_TIMEOUT\fP -
53
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.
57
58 .SH SEE ALSO
59 .BR libssh2_sftp_opendir(3)
60 .BR libssh2_sftp_closedir(3)