<PackageReference Include="SSH.NET" Version="2023.0.1" />

ISftpSession

Represents an SFTP session.
using Renci.SshNet.Sftp.Responses; using System; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; namespace Renci.SshNet.Sftp { internal interface ISftpSession : ISubsystemSession, IDisposable { uint ProtocolVersion { get; } string WorkingDirectory { get; } void ChangeDirectory(string path); string GetCanonicalPath(string path); Task<string> GetCanonicalPathAsync(string path, CancellationToken cancellationToken); SftpFileAttributes RequestFStat(byte[] handle, bool nullOnError); Task<SftpFileAttributes> RequestFStatAsync(byte[] handle, CancellationToken cancellationToken); SftpFileAttributes RequestStat(string path, bool nullOnError = false); SFtpStatAsyncResult BeginStat(string path, AsyncCallback callback, object state); SftpFileAttributes EndStat(SFtpStatAsyncResult asyncResult); SftpFileAttributes RequestLStat(string path); SFtpStatAsyncResult BeginLStat(string path, AsyncCallback callback, object state); SftpFileAttributes EndLStat(SFtpStatAsyncResult asyncResult); void RequestMkDir(string path); byte[] RequestOpen(string path, Flags flags, bool nullOnError = false); Task<byte[]> RequestOpenAsync(string path, Flags flags, CancellationToken cancellationToken); SftpOpenAsyncResult BeginOpen(string path, Flags flags, AsyncCallback callback, object state); byte[] EndOpen(SftpOpenAsyncResult asyncResult); byte[] RequestOpenDir(string path, bool nullOnError = false); Task<byte[]> RequestOpenDirAsync(string path, CancellationToken cancellationToken); void RequestPosixRename(string oldPath, string newPath); byte[] RequestRead(byte[] handle, ulong offset, uint length); SftpReadAsyncResult BeginRead(byte[] handle, ulong offset, uint length, AsyncCallback callback, object state); byte[] EndRead(SftpReadAsyncResult asyncResult); Task<byte[]> RequestReadAsync(byte[] handle, ulong offset, uint length, CancellationToken cancellationToken); KeyValuePair<string, SftpFileAttributes>[] RequestReadDir(byte[] handle); Task<KeyValuePair<string, SftpFileAttributes>[]> RequestReadDirAsync(byte[] handle, CancellationToken cancellationToken); SftpRealPathAsyncResult BeginRealPath(string path, AsyncCallback callback, object state); string EndRealPath(SftpRealPathAsyncResult asyncResult); void RequestRemove(string path); Task RequestRemoveAsync(string path, CancellationToken cancellationToken); void RequestRename(string oldPath, string newPath); Task RequestRenameAsync(string oldPath, string newPath, CancellationToken cancellationToken); void RequestRmDir(string path); void RequestSetStat(string path, SftpFileAttributes attributes); SftpFileSytemInformation RequestStatVfs(string path, bool nullOnError = false); Task<SftpFileSytemInformation> RequestStatVfsAsync(string path, CancellationToken cancellationToken); void RequestSymLink(string linkpath, string targetpath); void RequestFSetStat(byte[] handle, SftpFileAttributes attributes); void RequestWrite(byte[] handle, ulong serverOffset, byte[] data, int offset, int length, AutoResetEvent wait, Action<SftpStatusResponse> writeCompleted = null); Task RequestWriteAsync(byte[] handle, ulong serverOffset, byte[] data, int offset, int length, CancellationToken cancellationToken); void RequestClose(byte[] handle); Task RequestCloseAsync(byte[] handle, CancellationToken cancellationToken); SftpCloseAsyncResult BeginClose(byte[] handle, AsyncCallback callback, object state); void EndClose(SftpCloseAsyncResult asyncResult); uint CalculateOptimalReadLength(uint bufferSize); uint CalculateOptimalWriteLength(uint bufferSize, byte[] handle); ISftpFileReader CreateFileReader(byte[] handle, ISftpSession sftpSession, uint chunkSize, int maxPendingReads, long? fileSize); } }