1
.\" Copyright (C) The libssh2 project and its contributors.
2
.\" SPDX-License-Identifier: BSD-3-Clause
3
.TH libssh2_sftp_open_ex 3 "1 Jun 2007" "libssh2 0.15" "libssh2"
5
libssh2_sftp_open_ex - open filehandle for file on SFTP.
9
#include <libssh2_sftp.h>
12
libssh2_sftp_open_ex(LIBSSH2_SFTP *sftp, const char *filename,
13
unsigned int filename_len,
19
\fIsftp\fP - SFTP instance as returned by \fIlibssh2_sftp_init(3)\fP
21
\fIfilename\fP - Remote file/directory resource to open
23
\fIfilename_len\fP - Length of filename
25
\fIflags\fP - Any reasonable combination of the LIBSSH2_FXF_* constants:
28
Open the file for reading.
30
Open the file for writing. If both this and LIBSSH2_FXF_READ are specified,
31
the file is opened for both reading and writing.
33
Force all writes to append data at the end of the file.
35
If this flag is specified, then a new file will be created if one does not
36
already exist (if LIBSSH2_FXF_TRUNC is specified, the new file will be
37
truncated to zero length if it previously exists)
39
Forces an existing file with the same name to be truncated to zero length when
40
creating a file by specifying LIBSSH2_FXF_CREAT. LIBSSH2_FXF_CREAT MUST also
41
be specified if this flag is used.
43
Causes the request to fail if the named file already exists.
44
LIBSSH2_FXF_CREAT MUST also be specified if this flag is used.
47
\fImode\fP - POSIX file permissions to assign if the file is being newly
48
created. See the LIBSSH2_SFTP_S_* convenience defines in <libssh2_sftp.h>
50
\fIopen_type\fP - Either of LIBSSH2_SFTP_OPENFILE (to open a file) or
51
LIBSSH2_SFTP_OPENDIR (to open a directory).
53
A pointer to the newly created LIBSSH2_SFTP_HANDLE instance or NULL on
56
\fILIBSSH2_ERROR_ALLOC\fP - An internal memory allocation call failed.
58
\fILIBSSH2_ERROR_SOCKET_SEND\fP - Unable to send data on socket.
60
\fILIBSSH2_ERROR_SOCKET_TIMEOUT\fP -
62
\fILIBSSH2_ERROR_SFTP_PROTOCOL\fP - An invalid SFTP protocol response was
63
received on the socket, or an SFTP operation caused an errorcode to be
64
returned by the server.
66
\fILIBSSH2_ERROR_EAGAIN\fP - Marked for non-blocking I/O but the call would
69
.BR libssh2_sftp_close_handle(3)