wodSFTP API library - RemoteRead Method
      
 

Description
Reads from remote file.

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

Syntax

long Sftp_RemoteRead(void *Sftp, __int64 RemotePos, char *Buffer, int Length);

The RemoteRead function syntax has these parts:

Part Description
void *Sftp Handle of the created Sftp instance.
__int64 RemotePos Position in the file where reading occurs.
char *Buffer Buffer where data will be stored.
int Length Total 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).