From 6c3ba7c616b8d1f899a4522f1fcce9db83837c2b Mon Sep 17 00:00:00 2001 From: Brent Lewis Date: Thu, 4 May 2017 14:16:39 -0400 Subject: [PATCH] Implement SetLastAccessTime, SetLastWriteTime --- src/Renci.SshNet/SftpClient.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Renci.SshNet/SftpClient.cs b/src/Renci.SshNet/SftpClient.cs index 59d222bb9..cf90651bc 100644 --- a/src/Renci.SshNet/SftpClient.cs +++ b/src/Renci.SshNet/SftpClient.cs @@ -1506,10 +1506,11 @@ public IEnumerable ReadLines(string path, Encoding encoding) /// /// The file for which to set the access date and time information. /// A containing the value to set for the last access date and time of path. This value is expressed in local time. - [Obsolete("Note: This method currently throws NotImplementedException because it has not yet been implemented.")] public void SetLastAccessTime(string path, DateTime lastAccessTime) { - throw new NotImplementedException(); + var attribs = GetAttributes(path); + attribs.LastAccessTime = lastAccessTime; + SetAttributes(path, attribs); } /// @@ -1528,10 +1529,11 @@ public void SetLastAccessTimeUtc(string path, DateTime lastAccessTimeUtc) /// /// The file for which to set the date and time information. /// A containing the value to set for the last write date and time of path. This value is expressed in local time. - [Obsolete("Note: This method currently throws NotImplementedException because it has not yet been implemented.")] public void SetLastWriteTime(string path, DateTime lastWriteTime) { - throw new NotImplementedException(); + var attribs = GetAttributes(path); + attribs.LastWriteTime = lastWriteTime; + SetAttributes(path, attribs); } ///