1libssh2_sftp_read(3) libssh2 manual libssh2_sftp_read(3)
2
3
4
6 libssh2_sftp_read - read data from an SFTP handle
7
9 #include <libssh2.h> #include <libssh2_sftp.h>
10
11 ssize_t libssh2_sftp_read(LIBSSH2_SFTP_HANDLE *handle, char *buffer,
12 size_t buffer_maxlen);
13
14
16 handle is the SFTP File Handle as returned by libssh2_sftp_open_ex(3)
17
18 buffer is a pointer to a pre-allocated buffer of at least
19
20 buffer_maxlen bytes to read data into.
21
22 Reads a block of data from an LIBSSH2_SFTP_HANDLE. This method is mod‐
23 elled after the POSIX read(2) function and uses the same calling seman‐
24 tics. libssh2_sftp_read(3) will attempt to read as much as possible
25 however it may not fill all of buffer if the file pointer reaches the
26 end or if further reads would cause the socket to block.
27
29 Number of bytes actually populated into buffer, or negative on failure.
30 It returns LIBSSH2_ERROR_EAGAIN when it would otherwise block. While
31 LIBSSH2_ERROR_EAGAIN is a negative number, it isn't really a failure
32 per se.
33
35 LIBSSH2_ERROR_ALLOC - An internal memory allocation call failed.
36
37 LIBSSH2_ERROR_SOCKET_SEND - Unable to send data on socket.
38
39 LIBSSH2_ERROR_SOCKET_TIMEOUT -
40
41 LIBSSH2_ERROR_SFTP_PROTOCOL - An invalid SFTP protocol response was
42 received on the socket, or an SFTP operation caused an errorcode to be
43 returned by the server.
44
46 libssh2_sftp_open_ex(3) libssh2_sftp_read(3)
47
48
49
50libssh2 0.15 1 Jun 2007 libssh2_sftp_read(3)