Renci.SshNet.SftpClient.SetAttributes C# (CSharp) 메소드

SetAttributes() 공개 메소드

Sets the specified SftpFileAttributes of the file on the specified path.
is null. Client is not connected. The method was called after the client was disposed.
public SetAttributes ( string path, SftpFileAttributes fileAttributes ) : void
path string The path to the file.
fileAttributes SftpFileAttributes The desired .
리턴 void
        public void SetAttributes(string path, SftpFileAttributes fileAttributes)
        {
            CheckDisposed();

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

            var fullPath = _sftpSession.GetCanonicalPath(path);

            _sftpSession.RequestSetStat(fullPath, fileAttributes);
        }

Usage Example

예제 #1
0
파일: SftpClient.cs 프로젝트: zyfzgt/FTPbox
        public override void SetModifiedTime(SyncQueueItem i, DateTime time)
        {
            var attr = _sftpc.GetAttributes(i.CommonPath);

            attr.LastWriteTime = time;
            _sftpc.SetAttributes(i.CommonPath, attr);
        }