Renci.SshNet.SftpClient.GetAttributes C# (CSharp) Method

GetAttributes() public method

Gets the SftpFileAttributes of the file on the path.
is null. Client is not connected. was not found on the remote host. The method was called after the client was disposed.
public GetAttributes ( string path ) : SftpFileAttributes
path string The path to the file.
return SftpFileAttributes
        public SftpFileAttributes GetAttributes(string path)
        {
            CheckDisposed();

            if (_sftpSession == null)
                throw new SshConnectionException("Client not connected.");

            var fullPath = _sftpSession.GetCanonicalPath(path);

            return _sftpSession.RequestLStat(fullPath);
        }

Usage Example

Beispiel #1
0
        public override void SetModifiedTime(SyncQueueItem i, DateTime time)
        {
            var attr = _sftpc.GetAttributes(i.CommonPath);

            attr.LastWriteTime = time;
            _sftpc.SetAttributes(i.CommonPath, attr);
        }
All Usage Examples Of Renci.SshNet.SftpClient::GetAttributes