SFTP preserve original file timestamps?

Discussion of open issues, suggestions and bugs regarding network security and data protection solution - SecureBridge
Post Reply
snorkel
Posts: 384
Joined: Tue 08 Aug 2006 15:10
Location: Milwaukee WI USA

SFTP preserve original file timestamps?

Post by snorkel » Wed 12 Oct 2011 19:28

Is it possible to have the SFTP client save the files with the original timestamp as was on the server?

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Thu 13 Oct 2011 16:22

You can get the original timestamp of a server file using the TScSFTPClient.RetrieveAttributes method.
If you use the TScSFTPClient.DownloadFile method to download a file you should process the OnCreateLocalFile event handler, create a file, and set timestamp attributes for the locally created file, getting server values from the Attrs parameter (like AttrAttrs.CreateTime).
You can look at the example of processing the OnCreateLocalFile event in the SFTPClient demo.

Post Reply