Back to product page

LoopError callback


Called after wodSFTP performs operation on item and error occurs.

Syntax

  • C
void (*LoopError)(void *Sftp, char *LocalFile, char *RemoteFile, DirItemTypes ItemType, long *ErrorCode, char *ErrorText);
The LoopError(void *Sftp,char *LocalFile,char *RemoteFile,DirItemTypes ItemType,long *ErrorCode,char *ErrorText) syntax has these parts:
void *SftpHandle of the created Sftp instance.
char *LocalFileHolds full path to file/folder on local disk.
char *RemoteFileHolds full path to file/folder on remote server.
DirItemTypes ItemTypeA DirItemTypes enumeration. Type of the item - file, folder, symlink.
long *ErrorCodeCode of the error, if error occurred.
char *ErrorTextText description of the error, if available.

Remarks

The LoopError callback is called as result of error that occurred during execution of GetFiles, DeleteFiles, PutFiles and LoopFiles functions. Since those functions are working with many files/folders in a sequence, error may occur while, for example, creating directory, accessing files (like permission problems) etc.. When an error happens, this callback is called and error is provided in ErrorCode and ErrorText arguments. You can now evaluate the error to determine why your function failed.

You are allowed to set ErrorCode = 0 inside this event, which would cause method to continue performing its work on rest of items, completely ignoring the error. If you don't set ErrorCode to 0, then function will return immediately with the error as soon as you leave this callback.

NOTE: this callback is called only if you have created an instance of the SftpEventsStruct structure, and set its LoopError member to the function implementing it.

Platforms

Windows