Back to product page

Login function


Determines the username/login to be used with the server.

Type

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

Syntax

  • C
long Sftp_GetLogin(void *Sftp, char *Buffer, int *Bufsize);
long Sftp_SetLogin(void *Sftp, char *newVal);
The Login(void *Sftp,char *Buffer,int *Bufsize) syntax has these parts:
void *SftpHandle of the created Sftp instance.
char *BufferBuffer that will hold the returned string. Holds login/username for authentication on the server.
int *BufsizeSize of the buffer.

Remarks

This value MUST be set for wodSFTP to work. The SSH protocol specification (on top of which SFTP is running) requires that login information is sent during the 'handshake' - so that there is no user interaction during the login process.

For Password authentication, all the information needed for successful authorization with remote server is stored in the Login and Password properties.

If you prefer to use PublicKey authentication, see the PrivateKey property.

Login property can be empty if Authentication is set to authGSSAPI since wodSFTP will retrieve your username from the system.

The Bufsize variable should contain the maximum data length that can be stored in the Buffer variable. If you set Bufsize = 0, then the function will return with error ERROR_INSUFFICIENT_BUFFER and Bufsize will contain the required buffer size.

Platforms

Windows