Page 1 of 1

Preserve file timestamp?

Posted: Wed 27 Feb 2013 16:06
by snorkel
Hi,
Does Sbridge have a built in way to preserve the file timestamp, so it's the same when
you download the file as it was on the server?

Re: Preserve file timestamp?

Posted: Fri 20 Feb 2015 16:25
by sonico
Hello. Did you find a way to do this?

Re: Preserve file timestamp?

Posted: Tue 24 Feb 2015 11:02
by ViktorV
You can use the TScSFTPClient.OnCreateLocalFile event handler in order to set the CreateTime, AccessTime, ModifyTime values for the downloaded file equal to the server values. For this, you can use the SetFileTime WinAPI function. Note, that the SFTP protocol version must be 4 or higher, since the previous versions of SFTP don't return the CreateTime value.