mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-06 10:27:22 +09:00
Add functions to get the extension count, name and data.
This commit is contained in:
12
sample.c
12
sample.c
@@ -283,10 +283,12 @@ void do_sftp(SSH_SESSION *session){
|
||||
SFTP_FILE *fichier;
|
||||
SFTP_FILE *to;
|
||||
int len=1;
|
||||
int i;
|
||||
unsigned int i;
|
||||
char data[8000]={0};
|
||||
char *link;
|
||||
|
||||
unsigned int count;
|
||||
|
||||
if(!sftp_session){
|
||||
fprintf(stderr, "sftp error initialising channel: %s\n",
|
||||
ssh_get_error(session));
|
||||
@@ -298,6 +300,14 @@ void do_sftp(SSH_SESSION *session){
|
||||
return;
|
||||
}
|
||||
|
||||
printf("Additional SFTP extensions provided by the server:\n");
|
||||
count = sftp_extensions_get_count(sftp_session);
|
||||
for (i = 0; i < count; i++) {
|
||||
printf("\t%s, version: %s\n",
|
||||
sftp_extensions_get_name(sftp_session, i),
|
||||
sftp_extensions_get_data(sftp_session, i));
|
||||
}
|
||||
|
||||
/* test symlink and readlink */
|
||||
if (sftp_symlink(sftp_session, "/tmp/this_is_the_link",
|
||||
"/tmp/sftp_symlink_test") < 0) {
|
||||
|
||||
Reference in New Issue
Block a user