Table of Contents

Interface ISftpFile

Namespace
Renci.SshNet.Sftp
Assembly
Renci.SshNet.dll

Represents SFTP file information.

public interface ISftpFile

Properties

Attributes

Gets the file attributes.

SftpFileAttributes Attributes { get; }

Property Value

SftpFileAttributes

FullName

Gets the full path of the file or directory.

string FullName { get; }

Property Value

string

The full path of the file or directory.

GroupCanExecute

Gets or sets a value indicating whether the group members can execute this file.

bool GroupCanExecute { get; set; }

Property Value

bool

true if group members can execute this file; otherwise, false.

GroupCanRead

Gets or sets a value indicating whether the group members can read from this file.

bool GroupCanRead { get; set; }

Property Value

bool

true if group members can read from this file; otherwise, false.

GroupCanWrite

Gets or sets a value indicating whether the group members can write into this file.

bool GroupCanWrite { get; set; }

Property Value

bool

true if group members can write into this file; otherwise, false.

GroupId

Gets or sets file group id.

int GroupId { get; set; }

Property Value

int

File group id.

IsBlockDevice

Gets a value indicating whether file represents a block device.

bool IsBlockDevice { get; }

Property Value

bool

true if file represents a block device; otherwise, false.

IsCharacterDevice

Gets a value indicating whether file represents a character device.

bool IsCharacterDevice { get; }

Property Value

bool

true if file represents a character device; otherwise, false.

IsDirectory

Gets a value indicating whether file represents a directory.

bool IsDirectory { get; }

Property Value

bool

true if file represents a directory; otherwise, false.

IsNamedPipe

Gets a value indicating whether file represents a named pipe.

bool IsNamedPipe { get; }

Property Value

bool

true if file represents a named pipe; otherwise, false.

IsRegularFile

Gets a value indicating whether file represents a regular file.

bool IsRegularFile { get; }

Property Value

bool

true if file represents a regular file; otherwise, false.

IsSocket

Gets a value indicating whether file represents a socket.

bool IsSocket { get; }

Property Value

bool

true if file represents a socket; otherwise, false.

Gets a value indicating whether file represents a symbolic link.

bool IsSymbolicLink { get; }

Property Value

bool

true if file represents a symbolic link; otherwise, false.

LastAccessTime

Gets or sets the time the current file or directory was last accessed.

DateTime LastAccessTime { get; set; }

Property Value

DateTime

The time that the current file or directory was last accessed.

LastAccessTimeUtc

Gets or sets the time, in coordinated universal time (UTC), the current file or directory was last accessed.

DateTime LastAccessTimeUtc { get; set; }

Property Value

DateTime

The time that the current file or directory was last accessed.

LastWriteTime

Gets or sets the time when the current file or directory was last written to.

DateTime LastWriteTime { get; set; }

Property Value

DateTime

The time the current file was last written.

LastWriteTimeUtc

Gets or sets the time, in coordinated universal time (UTC), when the current file or directory was last written to.

DateTime LastWriteTimeUtc { get; set; }

Property Value

DateTime

The time the current file was last written.

Length

Gets the size, in bytes, of the current file.

long Length { get; }

Property Value

long

The size of the current file in bytes.

Name

Gets the name of the file or directory.

string Name { get; }

Property Value

string

The name of the file or directory.

Remarks

For directories, this is the name of the last directory in the hierarchy if a hierarchy exists; otherwise, the name of the directory.

OthersCanExecute

Gets or sets a value indicating whether the others can execute this file.

bool OthersCanExecute { get; set; }

Property Value

bool

true if others can execute this file; otherwise, false.

OthersCanRead

Gets or sets a value indicating whether the others can read from this file.

bool OthersCanRead { get; set; }

Property Value

bool

true if others can read from this file; otherwise, false.

OthersCanWrite

Gets or sets a value indicating whether the others can write into this file.

bool OthersCanWrite { get; set; }

Property Value

bool

true if others can write into this file; otherwise, false.

OwnerCanExecute

Gets or sets a value indicating whether the owner can execute this file.

bool OwnerCanExecute { get; set; }

Property Value

bool

true if owner can execute this file; otherwise, false.

OwnerCanRead

Gets or sets a value indicating whether the owner can read from this file.

bool OwnerCanRead { get; set; }

Property Value

bool

true if owner can read from this file; otherwise, false.

OwnerCanWrite

Gets or sets a value indicating whether the owner can write into this file.

bool OwnerCanWrite { get; set; }

Property Value

bool

true if owner can write into this file; otherwise, false.

UserId

Gets or sets file user id.

int UserId { get; set; }

Property Value

int

File user id.

Methods

Delete()

Permanently deletes a file on remote machine.

void Delete()

MoveTo(string)

Moves a specified file to a new location on remote machine, providing the option to specify a new file name.

void MoveTo(string destFileName)

Parameters

destFileName string

The path to move the file to, which can specify a different file name.

Exceptions

ArgumentNullException

destFileName is null.

SetPermissions(short)

Sets file permissions.

void SetPermissions(short mode)

Parameters

mode short

The mode.

UpdateStatus()

Updates file status on the server.

void UpdateStatus()