TScSFTPClient.CreateLink error

Discussion of open issues, suggestions and bugs regarding network security and data protection solution - SecureBridge
Post Reply
Marek-2
Posts: 5
Joined: Tue 28 Apr 2020 06:04

TScSFTPClient.CreateLink error

Post by Marek-2 » Tue 28 Apr 2020 06:57

I am trying to create a symbolic link with SecureBridge version 9.2.
On the server exists:
- file: /Test1/WebVersionInfo.txt
- folder: /Test2/
The CreateLink command is defined as:

Code: Select all

myClient.CreateLink('/Test2/WebVersionInfo.txt' , '/Test1/WebVersionInfo.txt')

This throw exception, I receive in OnError:
- Operation: opCreatingLink
- FileName: /Test2/WebVersionInfo.txt
- ErrorCode: 4
- ErrorMessage: Failure

What is here wrong?

I can create the link with WinSCP without problem.

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: TScSFTPClient.CreateLink error

Post by ViktorV » Thu 30 Apr 2020 15:59

Unfortunately, we haven't been able to reproduce the issue.
To solve the problem, try setting the TScSFTPClient.Version property value to vSFTP6. For this, in our SFTPClient demo project, before the line ScSFTPClient.Initialize insert the following code:
ScSFTPClient.Version := vSFTP6;
If this doesn't help, please allows us access to your SFTP server for testing purposes so that we could identify the issue and give you a complete answer. If this doesn't help, please allows us access to your SFTP server for testing purposes so that we could identify the issue and give you a complete answer. You can transfer the necessary information using the contact form https://devart.com/company/contactform.html

Marek-2
Posts: 5
Joined: Tue 28 Apr 2020 06:04

Re: TScSFTPClient.CreateLink error

Post by Marek-2 » Sat 09 May 2020 16:06

Hello Viktor,

thanks for your help.
Your suggestion: "the first and second parameters should be swapped" worked.
But I think that the description in the help file is not correct.

Code: Select all

procedure CreateLink(const LinkPath, TargetPath: string; Symbolic: boolean = True);

· LinkPath - specifies the path name of the new link to create. 
· TargetPath - specifies the path of an existing file system object to which the new-link-path will refer. 
From the description i have expected the first parameter as path to the new link file.
You have suggested the LinkPath as second parameter and it worked well.

Thanks,
Marek

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: TScSFTPClient.CreateLink error

Post by ViktorV » Thu 14 May 2020 11:52

The documentation contains correct information, which corresponds to the SFTP protocol specification. We tested the component on different servers to verify that the behavior is as defined in the documentation. The issue might be caused by a bug on your server.

Post Reply