libssh  0.10.6
The SSH library
sftp.h
1/*
2 * This file is part of the SSH Library
3 *
4 * Copyright (c) 2003-2008 by Aris Adamantiadis
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
37#ifndef SFTP_H
38#define SFTP_H
39
40#include <sys/types.h>
41
42#include "libssh.h"
43
44#ifdef __cplusplus
45extern "C" {
46#endif
47
48#ifdef _WIN32
49#ifndef uid_t
50 typedef uint32_t uid_t;
51#endif /* uid_t */
52#ifndef gid_t
53 typedef uint32_t gid_t;
54#endif /* gid_t */
55#ifdef _MSC_VER
56
57# ifndef _SSIZE_T_DEFINED
58# undef ssize_t
59# include <BaseTsd.h>
60 typedef _W64 SSIZE_T ssize_t;
61# define _SSIZE_T_DEFINED
62# endif /* _SSIZE_T_DEFINED */
63
64#endif /* _MSC_VER */
65#endif /* _WIN32 */
66
67#define LIBSFTP_VERSION 3
68
71typedef struct sftp_dir_struct* sftp_dir;
72typedef struct sftp_ext_struct *sftp_ext;
73typedef struct sftp_file_struct* sftp_file;
74typedef struct sftp_message_struct* sftp_message;
75typedef struct sftp_packet_struct* sftp_packet;
77typedef struct sftp_session_struct* sftp_session;
80
82 ssh_session session;
83 ssh_channel channel;
84 int server_version;
85 int client_version;
86 int version;
88 uint32_t id_counter;
89 int errnum;
90 void **handles;
91 sftp_ext ext;
92 sftp_packet read_packet;
93 /* Appended for CVE-2026-59848; allocated by libssh only, keep last */
94 struct ssh_list *outstanding_ids;
95};
96
98 sftp_session sftp;
99 uint8_t type;
100 ssh_buffer payload;
101};
102
103/* file handler */
105 sftp_session sftp;
106 char *name;
107 uint64_t offset;
108 ssh_string handle;
109 int eof;
110 int nonblocking;
111};
112
114 sftp_session sftp;
115 char *name;
116 ssh_string handle; /* handle to directory */
117 ssh_buffer buffer; /* contains raw attributes from server which haven't been parsed */
118 uint32_t count; /* counts the number of following attributes structures into buffer */
119 int eof; /* end of directory listing */
120};
121
123 sftp_session sftp;
124 uint8_t packet_type;
125 ssh_buffer payload;
126 uint32_t id;
127};
128
129/* this is a bunch of all data that could be into a message */
131 sftp_session sftp;
132 uint8_t type;
133 uint32_t id;
134 char *filename; /* can be "path" */
135 uint32_t flags;
136 sftp_attributes attr;
137 ssh_string handle;
138 uint64_t offset;
139 uint32_t len;
140 int attr_num;
141 ssh_buffer attrbuf; /* used by sftp_reply_attrs */
142 ssh_string data; /* can be newpath of rename() */
143 ssh_buffer complete_message; /* complete message in case of retransmission*/
144 char *str_data; /* cstring version of data */
145 char *submessage; /* for extended messages */
146};
147
150 sftp_message message;
151};
152
153/* SSH_FXP_MESSAGE described into .7 page 26 */
155 uint32_t id;
156 uint32_t status;
157 ssh_string error_unused; /* not used anymore */
158 ssh_string lang_unused; /* not used anymore */
159 char *errormsg;
160 char *langmsg;
161};
162
164 char *name;
165 char *longname; /* ls -l output on openssh, not reliable else */
166 uint32_t flags;
167 uint8_t type;
168 uint64_t size;
169 uint32_t uid;
170 uint32_t gid;
171 char *owner; /* set if openssh and version 4 */
172 char *group; /* set if openssh and version 4 */
173 uint32_t permissions;
174 uint64_t atime64;
175 uint32_t atime;
176 uint32_t atime_nseconds;
177 uint64_t createtime;
178 uint32_t createtime_nseconds;
179 uint64_t mtime64;
180 uint32_t mtime;
181 uint32_t mtime_nseconds;
182 ssh_string acl;
183 uint32_t extended_count;
184 ssh_string extended_type;
185 ssh_string extended_data;
186};
187
192 uint64_t f_bsize;
193 uint64_t f_frsize;
194 uint64_t f_blocks;
195 uint64_t f_bfree;
196 uint64_t f_bavail;
197 uint64_t f_files;
198 uint64_t f_ffree;
199 uint64_t f_favail;
200 uint64_t f_fsid;
201 uint64_t f_flag;
202 uint64_t f_namemax;
203};
204
219LIBSSH_API sftp_session sftp_new(ssh_session session);
220
231LIBSSH_API sftp_session sftp_new_channel(ssh_session session, ssh_channel channel);
232
233
239LIBSSH_API void sftp_free(sftp_session sftp);
240
253LIBSSH_API int sftp_init(sftp_session sftp);
254
267LIBSSH_API int sftp_get_error(sftp_session sftp);
268
277LIBSSH_API unsigned int sftp_extensions_get_count(sftp_session sftp);
278
288LIBSSH_API const char *sftp_extensions_get_name(sftp_session sftp, unsigned int indexn);
289
301LIBSSH_API const char *sftp_extensions_get_data(sftp_session sftp, unsigned int indexn);
302
320LIBSSH_API int sftp_extension_supported(sftp_session sftp, const char *name,
321 const char *data);
322
335LIBSSH_API sftp_dir sftp_opendir(sftp_session session, const char *path);
336
350LIBSSH_API sftp_attributes sftp_readdir(sftp_session session, sftp_dir dir);
351
361LIBSSH_API int sftp_dir_eof(sftp_dir dir);
362
375LIBSSH_API sftp_attributes sftp_stat(sftp_session session, const char *path);
376
392LIBSSH_API sftp_attributes sftp_lstat(sftp_session session, const char *path);
393
404LIBSSH_API sftp_attributes sftp_fstat(sftp_file file);
405
411LIBSSH_API void sftp_attributes_free(sftp_attributes file);
412
420LIBSSH_API int sftp_closedir(sftp_dir dir);
421
431LIBSSH_API int sftp_close(sftp_file file);
432
461LIBSSH_API sftp_file sftp_open(sftp_session session, const char *file, int accesstype,
462 mode_t mode);
463
469LIBSSH_API void sftp_file_set_nonblocking(sftp_file handle);
470
476LIBSSH_API void sftp_file_set_blocking(sftp_file handle);
477
492LIBSSH_API ssize_t sftp_read(sftp_file file, void *buf, size_t count);
493
525LIBSSH_API int sftp_async_read_begin(sftp_file file, uint32_t len);
526
550LIBSSH_API int sftp_async_read(sftp_file file, void *data, uint32_t len, uint32_t id);
551
568LIBSSH_API ssize_t sftp_write(sftp_file file, const void *buf, size_t count);
569
579LIBSSH_API int sftp_seek(sftp_file file, uint32_t new_offset);
580
591LIBSSH_API int sftp_seek64(sftp_file file, uint64_t new_offset);
592
602LIBSSH_API unsigned long sftp_tell(sftp_file file);
603
613LIBSSH_API uint64_t sftp_tell64(sftp_file file);
614
621LIBSSH_API void sftp_rewind(sftp_file file);
622
634LIBSSH_API int sftp_unlink(sftp_session sftp, const char *file);
635
647LIBSSH_API int sftp_rmdir(sftp_session sftp, const char *directory);
648
664LIBSSH_API int sftp_mkdir(sftp_session sftp, const char *directory, mode_t mode);
665
681LIBSSH_API int sftp_rename(sftp_session sftp, const char *original, const char *newname);
682
702LIBSSH_API int sftp_setstat(sftp_session sftp, const char *file, sftp_attributes attr);
703
719LIBSSH_API int sftp_chown(sftp_session sftp, const char *file, uid_t owner, gid_t group);
720
736LIBSSH_API int sftp_chmod(sftp_session sftp, const char *file, mode_t mode);
737
752LIBSSH_API int sftp_utimes(sftp_session sftp, const char *file, const struct timeval *times);
753
767LIBSSH_API int sftp_symlink(sftp_session sftp, const char *target, const char *dest);
768
782LIBSSH_API char *sftp_readlink(sftp_session sftp, const char *path);
783
795LIBSSH_API sftp_statvfs_t sftp_statvfs(sftp_session sftp, const char *path);
796
806LIBSSH_API sftp_statvfs_t sftp_fstatvfs(sftp_file file);
807
813LIBSSH_API void sftp_statvfs_free(sftp_statvfs_t statvfs_o);
814
829LIBSSH_API int sftp_fsync(sftp_file file);
830
842LIBSSH_API char *sftp_canonicalize_path(sftp_session sftp, const char *path);
843
851LIBSSH_API int sftp_server_version(sftp_session sftp);
852
853#ifdef WITH_SERVER
863LIBSSH_API sftp_session sftp_server_new(ssh_session session, ssh_channel chan);
864
872LIBSSH_API int sftp_server_init(sftp_session sftp);
873
879LIBSSH_API void sftp_server_free(sftp_session sftp);
880#endif /* WITH_SERVER */
881
882/* sftpserver.c */
883
884LIBSSH_API sftp_client_message sftp_get_client_message(sftp_session sftp);
885LIBSSH_API void sftp_client_message_free(sftp_client_message msg);
886LIBSSH_API uint8_t sftp_client_message_get_type(sftp_client_message msg);
887LIBSSH_API const char *sftp_client_message_get_filename(sftp_client_message msg);
888LIBSSH_API void sftp_client_message_set_filename(sftp_client_message msg, const char *newname);
889LIBSSH_API const char *sftp_client_message_get_data(sftp_client_message msg);
890LIBSSH_API uint32_t sftp_client_message_get_flags(sftp_client_message msg);
891LIBSSH_API const char *sftp_client_message_get_submessage(sftp_client_message msg);
892LIBSSH_API int sftp_send_client_message(sftp_session sftp, sftp_client_message msg);
893LIBSSH_API int sftp_reply_name(sftp_client_message msg, const char *name,
894 sftp_attributes attr);
895LIBSSH_API int sftp_reply_handle(sftp_client_message msg, ssh_string handle);
896LIBSSH_API ssh_string sftp_handle_alloc(sftp_session sftp, void *info);
897LIBSSH_API int sftp_reply_attr(sftp_client_message msg, sftp_attributes attr);
898LIBSSH_API void *sftp_handle(sftp_session sftp, ssh_string handle);
899LIBSSH_API int sftp_reply_status(sftp_client_message msg, uint32_t status, const char *message);
900LIBSSH_API int sftp_reply_names_add(sftp_client_message msg, const char *file,
901 const char *longname, sftp_attributes attr);
902LIBSSH_API int sftp_reply_names(sftp_client_message msg);
903LIBSSH_API int sftp_reply_data(sftp_client_message msg, const void *data, int len);
904LIBSSH_API void sftp_handle_remove(sftp_session sftp, void *handle);
905
906/* SFTP commands and constants */
907#define SSH_FXP_INIT 1
908#define SSH_FXP_VERSION 2
909#define SSH_FXP_OPEN 3
910#define SSH_FXP_CLOSE 4
911#define SSH_FXP_READ 5
912#define SSH_FXP_WRITE 6
913#define SSH_FXP_LSTAT 7
914#define SSH_FXP_FSTAT 8
915#define SSH_FXP_SETSTAT 9
916#define SSH_FXP_FSETSTAT 10
917#define SSH_FXP_OPENDIR 11
918#define SSH_FXP_READDIR 12
919#define SSH_FXP_REMOVE 13
920#define SSH_FXP_MKDIR 14
921#define SSH_FXP_RMDIR 15
922#define SSH_FXP_REALPATH 16
923#define SSH_FXP_STAT 17
924#define SSH_FXP_RENAME 18
925#define SSH_FXP_READLINK 19
926#define SSH_FXP_SYMLINK 20
927
928#define SSH_FXP_STATUS 101
929#define SSH_FXP_HANDLE 102
930#define SSH_FXP_DATA 103
931#define SSH_FXP_NAME 104
932#define SSH_FXP_ATTRS 105
933
934#define SSH_FXP_EXTENDED 200
935#define SSH_FXP_EXTENDED_REPLY 201
936
937/* attributes */
938/* sftp draft is completely braindead : version 3 and 4 have different flags for same constants */
939/* and even worst, version 4 has same flag for 2 different constants */
940/* follow up : i won't develop any sftp4 compliant library before having a clarification */
941
942#define SSH_FILEXFER_ATTR_SIZE 0x00000001
943#define SSH_FILEXFER_ATTR_PERMISSIONS 0x00000004
944#define SSH_FILEXFER_ATTR_ACCESSTIME 0x00000008
945#define SSH_FILEXFER_ATTR_ACMODTIME 0x00000008
946#define SSH_FILEXFER_ATTR_CREATETIME 0x00000010
947#define SSH_FILEXFER_ATTR_MODIFYTIME 0x00000020
948#define SSH_FILEXFER_ATTR_ACL 0x00000040
949#define SSH_FILEXFER_ATTR_OWNERGROUP 0x00000080
950#define SSH_FILEXFER_ATTR_SUBSECOND_TIMES 0x00000100
951#define SSH_FILEXFER_ATTR_EXTENDED 0x80000000
952#define SSH_FILEXFER_ATTR_UIDGID 0x00000002
953
954/* types */
955#define SSH_FILEXFER_TYPE_REGULAR 1
956#define SSH_FILEXFER_TYPE_DIRECTORY 2
957#define SSH_FILEXFER_TYPE_SYMLINK 3
958#define SSH_FILEXFER_TYPE_SPECIAL 4
959#define SSH_FILEXFER_TYPE_UNKNOWN 5
960
969#define SSH_FX_OK 0
971#define SSH_FX_EOF 1
973#define SSH_FX_NO_SUCH_FILE 2
975#define SSH_FX_PERMISSION_DENIED 3
977#define SSH_FX_FAILURE 4
979#define SSH_FX_BAD_MESSAGE 5
981#define SSH_FX_NO_CONNECTION 6
983#define SSH_FX_CONNECTION_LOST 7
985#define SSH_FX_OP_UNSUPPORTED 8
987#define SSH_FX_INVALID_HANDLE 9
989#define SSH_FX_NO_SUCH_PATH 10
991#define SSH_FX_FILE_ALREADY_EXISTS 11
993#define SSH_FX_WRITE_PROTECT 12
995#define SSH_FX_NO_MEDIA 13
996
999/* file flags */
1000#define SSH_FXF_READ 0x01
1001#define SSH_FXF_WRITE 0x02
1002#define SSH_FXF_APPEND 0x04
1003#define SSH_FXF_CREAT 0x08
1004#define SSH_FXF_TRUNC 0x10
1005#define SSH_FXF_EXCL 0x20
1006#define SSH_FXF_TEXT 0x40
1007
1008/* file type flags */
1009#define SSH_S_IFMT 00170000
1010#define SSH_S_IFSOCK 0140000
1011#define SSH_S_IFLNK 0120000
1012#define SSH_S_IFREG 0100000
1013#define SSH_S_IFBLK 0060000
1014#define SSH_S_IFDIR 0040000
1015#define SSH_S_IFCHR 0020000
1016#define SSH_S_IFIFO 0010000
1017
1018/* rename flags */
1019#define SSH_FXF_RENAME_OVERWRITE 0x00000001
1020#define SSH_FXF_RENAME_ATOMIC 0x00000002
1021#define SSH_FXF_RENAME_NATIVE 0x00000004
1022
1023#define SFTP_OPEN SSH_FXP_OPEN
1024#define SFTP_CLOSE SSH_FXP_CLOSE
1025#define SFTP_READ SSH_FXP_READ
1026#define SFTP_WRITE SSH_FXP_WRITE
1027#define SFTP_LSTAT SSH_FXP_LSTAT
1028#define SFTP_FSTAT SSH_FXP_FSTAT
1029#define SFTP_SETSTAT SSH_FXP_SETSTAT
1030#define SFTP_FSETSTAT SSH_FXP_FSETSTAT
1031#define SFTP_OPENDIR SSH_FXP_OPENDIR
1032#define SFTP_READDIR SSH_FXP_READDIR
1033#define SFTP_REMOVE SSH_FXP_REMOVE
1034#define SFTP_MKDIR SSH_FXP_MKDIR
1035#define SFTP_RMDIR SSH_FXP_RMDIR
1036#define SFTP_REALPATH SSH_FXP_REALPATH
1037#define SFTP_STAT SSH_FXP_STAT
1038#define SFTP_RENAME SSH_FXP_RENAME
1039#define SFTP_READLINK SSH_FXP_READLINK
1040#define SFTP_SYMLINK SSH_FXP_SYMLINK
1041#define SFTP_EXTENDED SSH_FXP_EXTENDED
1042
1043/* openssh flags */
1044#define SSH_FXE_STATVFS_ST_RDONLY 0x1 /* read-only */
1045#define SSH_FXE_STATVFS_ST_NOSUID 0x2 /* no setuid */
1046
1047#ifdef __cplusplus
1048}
1049#endif
1050
1051#endif /* SFTP_H */
1052
LIBSSH_API sftp_attributes sftp_fstat(sftp_file file)
Get information about a file or directory from a file handle.
Definition: sftp.c:3552
LIBSSH_API void sftp_file_set_nonblocking(sftp_file handle)
Make the sftp communication for this file handle non blocking.
Definition: sftp.c:2022
LIBSSH_API int sftp_mkdir(sftp_session sftp, const char *directory, mode_t mode)
Create a directory.
Definition: sftp.c:2546
LIBSSH_API int sftp_rename(sftp_session sftp, const char *original, const char *newname)
Rename or move a file or directory.
Definition: sftp.c:2652
LIBSSH_API const char * sftp_extensions_get_name(sftp_session sftp, unsigned int indexn)
Get the name of the extension provided by the server.
Definition: sftp.c:818
LIBSSH_API void sftp_statvfs_free(sftp_statvfs_t statvfs_o)
Free the memory of an allocated statvfs.
Definition: sftp.c:3362
LIBSSH_API int sftp_utimes(sftp_session sftp, const char *file, const struct timeval *times)
Change the last modification and access time of a file.
Definition: sftp.c:2849
LIBSSH_API sftp_attributes sftp_readdir(sftp_session session, sftp_dir dir)
Get a single file attributes structure of a directory.
Definition: sftp.c:1646
LIBSSH_API int sftp_seek64(sftp_file file, uint64_t new_offset)
Seek to a specific location in a file. This is the 64bit version.
Definition: sftp.c:2366
LIBSSH_API int sftp_closedir(sftp_dir dir)
Close a directory handle opened by sftp_opendir().
Definition: sftp.c:1877
LIBSSH_API int sftp_close(sftp_file file)
Close an open file handle.
Definition: sftp.c:1862
LIBSSH_API void sftp_server_free(sftp_session sftp)
Close and deallocate a sftp server session.
Definition: sftp.c:361
LIBSSH_API int sftp_async_read(sftp_file file, void *data, uint32_t len, uint32_t id)
Wait for an asynchronous read to complete and save the data.
Definition: sftp.c:2185
LIBSSH_API unsigned int sftp_extensions_get_count(sftp_session sftp)
Get the count of extensions provided by the server.
Definition: sftp.c:810
LIBSSH_API int sftp_get_error(sftp_session sftp)
Get the last sftp error.
Definition: sftp.c:583
LIBSSH_API unsigned long sftp_tell(sftp_file file)
Report current byte position in file.
Definition: sftp.c:2378
LIBSSH_API int sftp_unlink(sftp_session sftp, const char *file)
Unlink (delete) a file.
Definition: sftp.c:2393
LIBSSH_API sftp_attributes sftp_lstat(sftp_session session, const char *path)
Get information about a file or directory.
Definition: sftp.c:3548
LIBSSH_API sftp_statvfs_t sftp_fstatvfs(sftp_file file)
Get information about a mounted file system.
Definition: sftp.c:3282
LIBSSH_API int sftp_async_read_begin(sftp_file file, uint32_t len)
Start an asynchronous read from a file using an opened sftp file handle.
Definition: sftp.c:2142
LIBSSH_API void sftp_free(sftp_session sftp)
Close and deallocate a sftp session.
Definition: sftp.c:388
LIBSSH_API int sftp_seek(sftp_file file, uint32_t new_offset)
Seek to a specific location in a file.
Definition: sftp.c:2355
LIBSSH_API sftp_session sftp_server_new(ssh_session session, ssh_channel chan)
Create a new sftp server session.
Definition: sftp.c:262
LIBSSH_API void sftp_attributes_free(sftp_attributes file)
Free a sftp attribute structure.
Definition: sftp.c:1768
LIBSSH_API sftp_attributes sftp_stat(sftp_session session, const char *path)
Get information about a file or directory.
Definition: sftp.c:3544
LIBSSH_API const char * sftp_extensions_get_data(sftp_session sftp, unsigned int indexn)
Get the data of the extension provided by the server.
Definition: sftp.c:834
LIBSSH_API uint64_t sftp_tell64(sftp_file file)
Report current byte position in file.
Definition: sftp.c:2382
LIBSSH_API int sftp_chown(sftp_session sftp, const char *file, uid_t owner, gid_t group)
Change the file owner and group.
Definition: sftp.c:2826
LIBSSH_API char * sftp_readlink(sftp_session sftp, const char *path)
Read the value of a symbolic link.
Definition: sftp.c:2961
LIBSSH_API int sftp_extension_supported(sftp_session sftp, const char *name, const char *data)
Check if the given extension is supported.
Definition: sftp.c:850
LIBSSH_API sftp_session sftp_new_channel(ssh_session session, ssh_channel channel)
Start a new sftp session with an existing channel.
Definition: sftp.c:202
LIBSSH_API sftp_file sftp_open(sftp_session session, const char *file, int accesstype, mode_t mode)
Open a file on the server.
Definition: sftp.c:1893
LIBSSH_API void sftp_file_set_blocking(sftp_file handle)
Make the sftp communication for this file handle blocking.
Definition: sftp.c:2025
LIBSSH_API int sftp_rmdir(sftp_session sftp, const char *directory)
Remove a directory.
Definition: sftp.c:2472
LIBSSH_API void sftp_rewind(sftp_file file)
Rewinds the position of the file pointer to the beginning of the file.
Definition: sftp.c:2387
LIBSSH_API int sftp_dir_eof(sftp_dir dir)
Tell if the directory has reached EOF (End Of File).
Definition: sftp.c:1763
LIBSSH_API sftp_dir sftp_opendir(sftp_session session, const char *path)
Open a directory used to obtain directory entries.
Definition: sftp.c:1096
LIBSSH_API int sftp_init(sftp_session sftp)
Initialize the sftp protocol with the server.
Definition: sftp.c:714
LIBSSH_API ssize_t sftp_read(sftp_file file, void *buf, size_t count)
Read from a file using an opened sftp file handle.
Definition: sftp.c:2030
LIBSSH_API int sftp_server_version(sftp_session sftp)
Get the version of the SFTP protocol supported by the server.
Definition: sftp.c:1641
LIBSSH_API int sftp_setstat(sftp_session sftp, const char *file, sftp_attributes attr)
Set file attributes on a file, directory or symbolic link.
Definition: sftp.c:2739
LIBSSH_API char * sftp_canonicalize_path(sftp_session sftp, const char *path)
Canonicalize a sftp path.
Definition: sftp.c:3371
LIBSSH_API int sftp_server_init(sftp_session sftp)
Initialize the sftp server.
Definition: sftp.c:299
LIBSSH_API int sftp_symlink(sftp_session sftp, const char *target, const char *dest)
Create a symbolic link.
Definition: sftp.c:2866
LIBSSH_API sftp_session sftp_new(ssh_session session)
Creates a new sftp session.
Definition: sftp.c:128
LIBSSH_API int sftp_chmod(sftp_session sftp, const char *file, mode_t mode)
Change permissions of a file.
Definition: sftp.c:2839
LIBSSH_API sftp_statvfs_t sftp_statvfs(sftp_session sftp, const char *path)
Get information about a mounted file system.
Definition: sftp.c:3092
LIBSSH_API int sftp_fsync(sftp_file file)
Synchronize a file's in-core state with storage device.
Definition: sftp.c:3179
LIBSSH_API ssize_t sftp_write(sftp_file file, const void *buf, size_t count)
Write to a file using an opened sftp file handle.
Definition: sftp.c:2268
Definition: sftp.h:163
Definition: sftp.h:130
Definition: sftp.h:113
Definition: sftp.c:62
Definition: sftp.h:104
Definition: sftp.h:122
Definition: sftp.h:97
Definition: sftp.h:148
Definition: sftp.h:81
Definition: sftp.h:154
SFTP statvfs structure.
Definition: sftp.h:191
uint64_t f_blocks
Definition: sftp.h:194
uint64_t f_ffree
Definition: sftp.h:198
uint64_t f_files
Definition: sftp.h:197
uint64_t f_bavail
Definition: sftp.h:196
uint64_t f_namemax
Definition: sftp.h:202
uint64_t f_bfree
Definition: sftp.h:195
uint64_t f_favail
Definition: sftp.h:199
uint64_t f_flag
Definition: sftp.h:201
uint64_t f_frsize
Definition: sftp.h:193
uint64_t f_fsid
Definition: sftp.h:200
Definition: buffer.c:48
Definition: channels.h:66
Definition: misc.h:45
Definition: session.h:127
Definition: string.h:33