Back to product page

RemoteRead function


Reads from remote file.

Type

A Long value. If successful, 0 is returned, otherwise error as specified here

Syntax

  • C
long Sftp_RemoteRead(void *Sftp, __int64 RemotePos, char *Buffer, int Length);
The RemoteRead(void *Sftp,__int64 RemotePos,char *Buffer,int Length) syntax has these parts:
void *SftpHandle of the created Sftp instance.
__int64 RemotePosPosition in the file where reading occurs.
char *BufferBuffer where data will be stored.
int LengthTotal number of bytes to read. Buffer must be large enough.

Remarks

The RemoteRead function will read data from remote file opened with RemoteOpen function. When data is received, it will be provided to your application through RemoteData callback. When receive completes, Done callback will be called, where you can call new RemoteRead function, close remote file etc.. During the transfer, Progress callback WILL NOT be called.

After you finish reading all the data, don't forget to call RemoteClose. You can not call other methods until RemoteClose is called (for example, you cannot call GetFile).

In Blocking mode, RemoteRead will return data immediately to you (so you can ignore RemoteData callback).

Platforms

Windows