]> src.bluestatic.org Git - printdrop.git/blob - man3/libssh2_sftp_read.3
Add a help menu item to display the current print queue
[printdrop.git] / man3 / libssh2_sftp_read.3
1 .\" $Id: libssh2_sftp_read.3,v 1.8 2007/06/13 16:41:33 jehousley Exp $
2 .\"
3 .TH libssh2_sftp_read 3 "1 Jun 2007" "libssh2 0.15" "libssh2 manual"
4 .SH NAME
5 libssh2_sftp_read - read data from an SFTP handle
6 .SH SYNOPSIS
7 #include <libssh2.h>
8 #include <libssh2_sftp.h>
9
10 ssize_t
11 libssh2_sftp_read(LIBSSH2_SFTP_HANDLE *handle, char *buffer, size_t buffer_maxlen);
12
13 .SH DESCRIPTION
14 \fIhandle\fP is the SFTP File Handle as returned by
15 .BR libssh2_sftp_open(3)
16
17 \fIbuffer\fP is a pointer to a pre-allocated buffer of at least
18
19 \fIbuffer_maxlen\fP bytes to read data into.
20
21 Reads a block of data from an LIBSSH2_SFTP_HANDLE. This method is modelled
22 after the POSIX
23 .BR read(2)
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.
29
30 .SH RETURN VALUE
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.
34 .SH ERRORS
35 \fILIBSSH2_ERROR_ALLOC\fP - An internal memory allocation call failed.
36
37 \fILIBSSH2_ERROR_SOCKET_SEND\fP - Unable to send data on socket.
38
39 \fILIBSSH2_ERROR_SOCKET_TIMEOUT\fP -
40
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.
44
45 .SH SEE ALSO
46 .BR libssh2_sftp_open(3)
47 .BR libssh2_sftp_readnb(3)