1 .\" $Id: libssh2_sftp_read.3,v 1.8 2007/06/13 16:41:33 jehousley Exp $
3 .TH libssh2_sftp_read 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
5 libssh2_sftp_read - read data from an SFTP handle
8 #include <libssh2_sftp.h>
11 libssh2_sftp_read(LIBSSH2_SFTP_HANDLE *handle, char *buffer, size_t buffer_maxlen);
14 \fIhandle\fP is the SFTP File Handle as returned by
15 .BR libssh2_sftp_open(3)
17 \fIbuffer\fP is a pointer to a pre-allocated buffer of at least
19 \fIbuffer_maxlen\fP bytes to read data into.
21 Reads a block of data from an LIBSSH2_SFTP_HANDLE. This method is modelled
24 function and uses the same calling semantics.
25 .BR libssh2_sftp_read(3)
26 will attempt to read as much as possible however it may not fill all of
27 buffer if the file pointer reaches the end or
28 if further reads would cause the socket to block.
31 Number of bytes actually populated into buffer, or negative on failure.
32 It returns LIBSSH2_ERROR_EAGAIN when it would otherwise block. While
33 LIBSSH2_ERROR_EAGAIN is a negative number, it isn't really a failure per se.
35 \fILIBSSH2_ERROR_ALLOC\fP - An internal memory allocation call failed.
37 \fILIBSSH2_ERROR_SOCKET_SEND\fP - Unable to send data on socket.
39 \fILIBSSH2_ERROR_SOCKET_TIMEOUT\fP -
41 \fILIBSSH2_ERROR_SFTP_PROTOCOL\fP - 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.
46 .BR libssh2_sftp_open(3)
47 .BR libssh2_sftp_readnb(3)