Page 1 of 1

SFTP SetAttributes() issue

Posted: Tue 08 Sep 2009 18:14
by RJ
When trying to use the ScSFTPClient.SetAttributes() function I get the following exception: class EScError ... "Timeout expired, SFTP server have not responded".

The timeout value is set to 15 and the error occur immediately after calling the function.

I've tried ScSFTPClient.SetAttributesByHandle() as well and with the same result.

Posted: Thu 10 Sep 2009 07:51
by Dimon
I could not reproduce the problem. Please send me a complete small sample to dmitryg*devart*com to demonstrate it.

Posted: Thu 10 Sep 2009 12:38
by RJ
A small example project has been sent. I've only tried it against OpenSSH server running on Ubuntu (latest version).

Posted: Mon 14 Sep 2009 11:27
by Dimon
This problem is arisen because OpenSSH server closes the connection with SFTP client when receiving the command to change specified attributes.
To solve this probelm, you should add the following code before calling the SetAttributes method:

Code: Select all

attr.ValidAttributes := attr.ValidAttributes - [aAccessTime];

Posted: Tue 15 Sep 2009 10:49
by RJ
That worked. Thank you!