Quantcast
Channel: Rebex Q&A Forum - Recent questions and answers
Viewing all articles
Browse latest Browse all 3862

Answered: SFTP GetFile - How to retain original date/time file when copy

$
0
0

You can instruct Rebex SFTP to restore date/time using Sftp.Settings.RestoreDateTime property.

Sample code:

using (var sftp = new Sftp())
{
    sftp.Connect("test.rebex.net");
    sftp.Login("demo", "password");

    // restore last write time in subsequent operations
    sftp.Settings.RestoreDateTime = ItemDateTimes.LastWriteTime;

    // download the file
    sftp.GetFile("readme.txt", "readme.txt");
}

Viewing all articles
Browse latest Browse all 3862

Trending Articles