Back to product page

GetDataToBufferAt function


Retrieves the contents of a remote file to a locally specified buffer.

Type

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

Syntax

  • C
long Sftp_GetDataToBufferAt(void *Sftp, char * RemoteFile, char *Buffer, int BufSize);
The GetDataToBufferAt(void *Sftp,char *RemoteFile,__int64 RemotePos,char *Buffer,int *BufSize) syntax has these parts:
void *SftpHandle of the created Sftp instance.
char *RemoteFileFull path to a file on the server.
__int64 RemotePosPosition in the file from where copying is performed.
char *BufferPointer to allocated buffer where data will be stored.
int *BufSizePointer to the size of the buffer.

Remarks

GetDataToBufferAt will get part of the file from the server and copy it to the local buffer that you have allocated. When the transfer is complete, the Done callback will fire.

wodSFTPdll will copy as many bytes as you specify in BufSize. When all data is retrieved and Done was called, your BufSize variable will be filled with value representing total number of bytes actually received. You can use the RemotePos argument to specify a position in the file at which copying will commence.

Platforms

Windows