libssh2

Форк
0
/
libssh2_sftp_readdir_ex.3 
68 строк · 2.7 Кб
1
.\" Copyright (C) The libssh2 project and its contributors.
2
.\" SPDX-License-Identifier: BSD-3-Clause
3
.TH libssh2_sftp_readdir_ex 3 "1 Jun 2007" "libssh2 0.15" "libssh2"
4
.SH NAME
5
libssh2_sftp_readdir_ex - read directory data from an SFTP handle
6
.SH SYNOPSIS
7
.nf
8
#include <libssh2.h>
9
#include <libssh2_sftp.h>
10

11
int
12
libssh2_sftp_readdir_ex(LIBSSH2_SFTP_HANDLE *handle,
13
                        char *buffer, size_t buffer_maxlen,
14
                        char *longentry, size_t longentry_maxlen,
15
                        LIBSSH2_SFTP_ATTRIBUTES *attrs);
16
.fi
17
.SH DESCRIPTION
18
Reads a block of data from a LIBSSH2_SFTP_HANDLE and returns file entry
19
information for the next entry, if any.
20

21
\fIhandle\fP - is the SFTP File Handle as returned by
22
.BR libssh2_sftp_open_ex(3)
23

24
\fIbuffer\fP - is a pointer to a pre-allocated buffer of at least
25
\fIbuffer_maxlen\fP bytes to read data into.
26

27
\fIbuffer_maxlen\fP - is the length of buffer in bytes. If the length of the
28
filename is longer than the space provided by buffer_maxlen it will be
29
truncated to fit.
30

31
\fIlongentry\fP - is a pointer to a pre-allocated buffer of at least
32
\fIlongentry_maxlen\fP bytes to read data into. The format of the `longname'
33
field is unspecified by SFTP protocol. It MUST be suitable for use in the
34
output of a directory listing command (in fact, the recommended operation for
35
a directory listing command is to display this data).
36

37
\fIlongentry_maxlen\fP - is the length of longentry in bytes. If the length of
38
the full directory entry is longer than the space provided by
39
\fIlongentry_maxlen\fP it will be truncated to fit.
40

41
\fIattrs\fP - is a pointer to LIBSSH2_SFTP_ATTRIBUTES storage to populate
42
statbuf style data into.
43
.SH RETURN VALUE
44
Number of bytes actually populated into buffer (not counting the terminating
45
zero), or negative on failure. It returns LIBSSH2_ERROR_EAGAIN when it would
46
otherwise block. While LIBSSH2_ERROR_EAGAIN is a negative number, it is not
47
really a failure per se.
48
.SH BUG
49
Passing in a too small buffer for 'buffer' or 'longentry' when receiving data
50
only results in libssh2 1.2.7 or earlier to not copy the entire data amount,
51
and it is not possible for the application to tell when it happens!
52
.SH ERRORS
53
\fILIBSSH2_ERROR_ALLOC\fP - An internal memory allocation call failed.
54

55
\fILIBSSH2_ERROR_SOCKET_SEND\fP - Unable to send data on socket.
56

57
\fILIBSSH2_ERROR_SOCKET_TIMEOUT\fP -
58

59
\fILIBSSH2_ERROR_SFTP_PROTOCOL\fP - An invalid SFTP protocol response was
60
received on the socket, or an SFTP operation caused an errorcode to be
61
returned by the server.
62

63
From 1.2.8, LIBSSH2_ERROR_BUFFER_TOO_SMALL is returned if any of the
64
given 'buffer' or 'longentry' buffers are too small to fit the requested
65
object name.
66
.SH SEE ALSO
67
.BR libssh2_sftp_open_ex(3),
68
.BR libssh2_sftp_close_handle(3)
69

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.