> -----Original Message-----
> From: [email protected] 
> [mailto:[email protected]] On Behalf Of 
> Daniel Stenberg
> Sent: Friday, September 18, 2009 3:06 PM
> To: libssh2 development
> Subject: Re: example of sftp.c
> 
> Then you need to read the code to see what it does:
> 
>      do {
>          char mem[1024];
> 
>          /* loop until we fail */
>          fprintf(stderr, "libssh2_sftp_read()!\n");
>          rc = libssh2_sftp_read(sftp_handle, mem, sizeof(mem));
>          if (rc > 0) {
>              write(1, mem, rc);
>          } else {
>              break;
>          }
>      } while (1);

Ahhh, it is writing to stdout. No wonder there isn't a local copy. After 
changing the first parameter of write() from 1 to 2 (to let it write to 
stderr), I can see the content of the file it reads.

Thanks for pointing this out,
Xu Qiang
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

Reply via email to