How to preserve timestamp while downloading file from UNIX server?
i.e. if my file date-time on UNIX server is 01 Mar 2014 10:56PM
And if download the file on 10 Mar 2014 at 03:45 PM then file date-time will get changed to 10 Mar 2014 03:45 PM.
How to preserve timestamp while downloading file from UNIX server?
i.e. if my file date-time on UNIX server is 01 Mar 2014 10:56PM
And if download the file on 10 Mar 2014 at 03:45 PM then file date-time will get changed to 10 Mar 2014 03:45 PM.
You can use the following code snippet to sync last write time of the remote files:
[code lang='c#']
We understand your issue. For the version 5.3 we would suggest using the Progress event to set the LastWriteTime when the state is FileDownloaded. You can get the lastwritetime of the file in the event data object.
In the v6.0 that we will release in April, there is an option that helps you do so.
As per your suggestion, I added one line in switch case of public void Progress(object sender, FileSystemProgressEventArgs e) function
case TransferState.FileUploaded:
client.SetLastWriteTime(e.DestinationPath, e.SourceFileInfo.LastWriteTime);
case TransferState.FileDownloaded:
File.SetLastWriteTime(e.DestinationPath, e.SourceFileInfo.LastWriteTime);
And it worked, thank you for your support.