Interface ISshFileHandle
Represents an open SFTP file handle for direct data operations.
Namespace: ApacheMinaSSHD.NET.Wrapper.Abstractions.Models
Assembly: ApacheMinaSSHD.NET.Wrapper.dll
Syntax
public interface ISshFileHandle
Properties
| Edit this page View SourceAccessMask
Gets the SFTP access mask used to open the file.
Declaration
int AccessMask { get; }
Property Value
| Type | Description |
|---|---|
| int |
Attributes
Gets file attributes captured for the handle.
Declaration
IReadOnlyDictionary<string, object> Attributes { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyDictionary<string, object> |
IsOpenAppend
Gets whether the file is open in append mode.
Declaration
bool IsOpenAppend { get; }
Property Value
| Type | Description |
|---|---|
| bool |
SshHandle
Gets the underlying safe handle metadata.
Declaration
ISshHandle SshHandle { get; }
Property Value
| Type | Description |
|---|---|
| ISshHandle |
Methods
| Edit this page View SourceAppend(byte[], int, int?)
Appends data to the file.
Declaration
void Append(byte[] data, int offset = 0, int? length = null)
Parameters
| Type | Name | Description |
|---|---|---|
| byte[] | data | The source buffer. |
| int | offset | The source buffer offset. |
| int? | length | The number of bytes to append, or |
AsStream()
Returns a .NET stream wrapper over this file handle.
Declaration
Stream AsStream()
Returns
| Type | Description |
|---|---|
| Stream | A stream backed by this SFTP file handle. |
Close()
Closes the file handle.
Declaration
void Close()
Lock(long, long, int)
Locks a file region.
Declaration
void Lock(long offset, long length, int mask)
Parameters
| Type | Name | Description |
|---|---|---|
| long | offset | The file region offset. |
| long | length | The file region length. |
| int | mask | The lock mask supplied by the client. |
Read(byte[], long, out bool, int, int?)
Reads data from the file and reports end-of-file state.
Declaration
int Read(byte[] data, long fileOffset, out bool isEof, int dataOffset = 0, int? length = null)
Parameters
| Type | Name | Description |
|---|---|---|
| byte[] | data | The destination buffer. |
| long | fileOffset | The file offset to read from. |
| bool | isEof | Set to |
| int | dataOffset | The destination buffer offset. |
| int? | length | The number of bytes to read, or |
Returns
| Type | Description |
|---|---|
| int | The number of bytes read. |
Read(byte[], long, int, int?)
Reads data from the file.
Declaration
int Read(byte[] data, long fileOffset, int dataOffset = 0, int? length = null)
Parameters
| Type | Name | Description |
|---|---|---|
| byte[] | data | The destination buffer. |
| long | fileOffset | The file offset to read from. |
| int | dataOffset | The destination buffer offset. |
| int? | length | The number of bytes to read, or |
Returns
| Type | Description |
|---|---|
| int | The number of bytes read. |
Unlock(long, long)
Unlocks a file region.
Declaration
void Unlock(long offset, long length)
Parameters
| Type | Name | Description |
|---|---|---|
| long | offset | The file region offset. |
| long | length | The file region length. |
Write(byte[], long, int, int?)
Writes data to the file.
Declaration
void Write(byte[] data, long fileOffset, int dataOffset = 0, int? length = null)
Parameters
| Type | Name | Description |
|---|---|---|
| byte[] | data | The source buffer. |
| long | fileOffset | The file offset to write to. |
| int | dataOffset | The source buffer offset. |
| int? | length | The number of bytes to write, or |