SFTP preserve original file timestamps?
SFTP preserve original file timestamps?
Is it possible to have the SFTP client save the files with the original timestamp as was on the server?
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.
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.