example for setAttributes

Discussion of open issues, suggestions and bugs regarding network security and data protection solution - SecureBridge
Post Reply
bilbo194
Posts: 2
Joined: Mon 13 Aug 2012 11:33

example for setAttributes

Post by bilbo194 » Mon 13 Aug 2012 11:50

Hello,

I like to change the date of a file after uploaded it to a distant server to preserve to date after uploading (is it the right way to do that ?).

I try :

Code: Select all

   SFTP.UploadFile(sF,'/root/' + ExtractFileName(sF), false);
   attr.ValidAttributes := [aModifyTime] ;
   attr.ModifyTime := DateToSet;
   SFTP.SetAttributes('/root/' + ExtractFileName(sF),attr) ;
The date on the server is not changed

Distant server has OpennSSH on Debian
Sending server is Windows 2003
SecureBridgeVersion = '3.00.0.2';

Thanks for your help,
Jean-Michel

AndreyZ

Re: example for setAttributes

Post by AndreyZ » Tue 14 Aug 2012 10:01

Hello,

You are using the correct way of setting the modify time of a remote file. Unfortunatelly, we cannot reproduce the problem with not setting the modify time by using the SetAttributes method. Please try using the OnSetRemoteFileAttributes event handler and check if the problem remains. The OnSetRemoteFileAttributes event occurs when copying a file from a local machine to a remote one during the UploadFile method call. On processing this event you can set the attributes for the remote file using the Attrs object.

bilbo194
Posts: 2
Joined: Mon 13 Aug 2012 11:33

Re: example for setAttributes

Post by bilbo194 » Tue 14 Aug 2012 16:20

Hello,

It is only :

Code: Select all

	Attrs.ModifyTime := DateToSet
in SetRemoteFileAttributes ?

Because it does not change the date of the file.

Thanks for your help

AndreyZ

Re: example for setAttributes

Post by AndreyZ » Thu 16 Aug 2012 12:26

Thank you for the information. We will fix this problem in the next SecureBridge version.

Post Reply