Subject: Re: libssh2_sftp_read reads a number of bytes smaller than both the file size and the specified buffer size

Re: libssh2_sftp_read reads a number of bytes smaller than both the file size and the specified buffer size

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 3 Apr 2012 23:47:28 +0200 (CEST)

On Tue, 3 Apr 2012, Adam Craig wrote:

> If I upload a file of 200K all in one call to libssh2_sftp_write and it
> returns 30K when it actually uploaded all 200K, what does the 30K return
> value mean?

It means 30K was sent off and that you need to call it again with the
remaining 170K. In a very similar fashion to how write() and similar function
calls work.

> Does the documentation explain this somewhere?
> All te information on this I could find was
> http://www.libssh2.org/libssh2_sftp_write.html:
> "RETURN VALUE
>
> Actual number of bytes written or negative on failure.

Based on your questions, I figure we need to expand this to explain it with
more detail!

-- 
  / daniel.haxx.se
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2012-04-03