mirror of
https://github.com/libssh2/libssh2.git
synced 2025-07-31 00:03:08 +03:00
sftp: add open functions with custom attribute support
Before this patch, libssh2 sent hardcoded `LIBSSH2_SFTP_ATTRIBUTES` struct on handle open. This can be problematic on some special OS, where the file size should be known on new file creation. I added two new functions to resolve this issue. Patch-by: @vajdaakos on github via #506 Changes compared to #506: - drop attr size fixup in favour of #946. - move `memcpy()` under the state where we need it. - bump filename length type to `size_t`. - fix filenames in documentation and other nits. Closes #506 Closes #947
This commit is contained in:
23
docs/libssh2_sftp_open_r.3
Normal file
23
docs/libssh2_sftp_open_r.3
Normal file
@ -0,0 +1,23 @@
|
||||
.TH libssh2_sftp_open_r 3 "10 Apr 2023" "libssh2 1.11.0" "libssh2 manual"
|
||||
.SH NAME
|
||||
libssh2_sftp_open_r - convenience macro for \fIlibssh2_sftp_open_ex_r(3)\fP calls
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <libssh2.h>
|
||||
#include <libssh2_sftp.h>
|
||||
|
||||
LIBSSH2_SFTP_HANDLE *
|
||||
libssh2_sftp_open_r(LIBSSH2_SFTP *sftp, const char *filename,
|
||||
unsigned long flags,
|
||||
long mode,
|
||||
LIBSSH2_SFTP_ATTRIBUTES *attrs);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
This is a macro defined in a public libssh2 header file that is using the
|
||||
underlying function \fIlibssh2_sftp_open_ex_r(3)\fP.
|
||||
.SH RETURN VALUE
|
||||
See \fIlibssh2_sftp_open_ex_r(3)\fP
|
||||
.SH ERRORS
|
||||
See \fIlibssh2_sftp_open_ex_r(3)\fP
|
||||
.SH SEE ALSO
|
||||
.BR libssh2_sftp_open_ex_r(3)
|
Reference in New Issue
Block a user