Show / Hide Table of Contents

    Interface IUnixFileSystem

    The unix file system abstraction used by the FTP server.

    Namespace: FubarDev.FtpServer.FileSystem
    Assembly: FubarDev.FtpServer.Abstractions.dll
    Syntax
    public interface IUnixFileSystem

    Properties

    | Improve this Doc View Source

    FileSystemEntryComparer

    Gets a string comparer for file system entry names.

    Declaration
    StringComparer FileSystemEntryComparer { get; }
    Property Value
    Type Description
    StringComparer
    Remarks

    Required to support case insensitive file systems.

    | Improve this Doc View Source

    Root

    Gets the root directory entry.

    Declaration
    IUnixDirectoryEntry Root { get; }
    Property Value
    Type Description
    IUnixDirectoryEntry
    | Improve this Doc View Source

    SupportsAppend

    Gets a value indicating whether this file system supports appending to a file.

    Declaration
    bool SupportsAppend { get; }
    Property Value
    Type Description
    Boolean
    | Improve this Doc View Source

    SupportsNonEmptyDirectoryDelete

    Gets a value indicating whether this file system supports deletion of non-empty directories.

    Declaration
    bool SupportsNonEmptyDirectoryDelete { get; }
    Property Value
    Type Description
    Boolean

    Methods

    | Improve this Doc View Source

    AppendAsync(IUnixFileEntry, Nullable<Int64>, Stream, CancellationToken)

    Appends data to a file.

    Declaration
    Task<IBackgroundTransfer? > AppendAsync(IUnixFileEntry fileEntry, long? startPosition, Stream data, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    IUnixFileEntry fileEntry

    The IUnixFileEntry to append data to.

    Nullable<Int64> startPosition

    The start position - when it is null, the data is appended.

    Stream data

    The data stream to read from.

    CancellationToken cancellationToken

    The cancellation token.

    Returns
    Type Description
    Task<Nullable<IBackgroundTransfer>>

    an optional IBackgroundTransfer when the transfer needs to happen in the background.

    | Improve this Doc View Source

    CreateAsync(IUnixDirectoryEntry, String, Stream, CancellationToken)

    Creates a file with the given fileName and data.

    Declaration
    Task<IBackgroundTransfer? > CreateAsync(IUnixDirectoryEntry targetDirectory, string fileName, Stream data, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    IUnixDirectoryEntry targetDirectory

    The directory to create the file in.

    String fileName

    The name of the new file.

    Stream data

    The Stream used to read the data for the new file.

    CancellationToken cancellationToken

    The cancellation token.

    Returns
    Type Description
    Task<Nullable<IBackgroundTransfer>>

    an optional IBackgroundTransfer when the transfer needs to happen in the background.

    | Improve this Doc View Source

    CreateDirectoryAsync(IUnixDirectoryEntry, String, CancellationToken)

    Creates a sub directory with the name directoryName in targetDirectory.

    Declaration
    Task<IUnixDirectoryEntry> CreateDirectoryAsync(IUnixDirectoryEntry targetDirectory, string directoryName, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    IUnixDirectoryEntry targetDirectory

    The directory to create the sub directory in.

    String directoryName

    The name of the new sub directory.

    CancellationToken cancellationToken

    The cancellation token.

    Returns
    Type Description
    Task<IUnixDirectoryEntry>

    The new IUnixDirectoryEntry.

    | Improve this Doc View Source

    GetEntriesAsync(IUnixDirectoryEntry, CancellationToken)

    Gets a list of IUnixFileSystemEntry objects for a given directoryEntry.

    Declaration
    Task<IReadOnlyList<IUnixFileSystemEntry>> GetEntriesAsync(IUnixDirectoryEntry directoryEntry, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    IUnixDirectoryEntry directoryEntry

    The IUnixDirectoryEntry to get the file system entries for.

    CancellationToken cancellationToken

    The cancellation token.

    Returns
    Type Description
    Task<IReadOnlyList<IUnixFileSystemEntry>>

    The list of IUnixFileSystemEntry objects for a given directoryEntry.

    | Improve this Doc View Source

    GetEntryByNameAsync(IUnixDirectoryEntry, String, CancellationToken)

    Gets a file system entry by name.

    Declaration
    Task<IUnixFileSystemEntry? > GetEntryByNameAsync(IUnixDirectoryEntry directoryEntry, string name, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    IUnixDirectoryEntry directoryEntry

    The IUnixDirectoryEntry to get the file system entry for.

    String name

    The name of the file system entry to search.

    CancellationToken cancellationToken

    The cancellation token.

    Returns
    Type Description
    Task<Nullable<IUnixFileSystemEntry>>

    Returns the found IUnixFileSystemEntry.

    | Improve this Doc View Source

    MoveAsync(IUnixDirectoryEntry, IUnixFileSystemEntry, IUnixDirectoryEntry, String, CancellationToken)

    Moves a file system entry from parent to target.

    Declaration
    Task<IUnixFileSystemEntry> MoveAsync(IUnixDirectoryEntry parent, IUnixFileSystemEntry source, IUnixDirectoryEntry target, string fileName, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    IUnixDirectoryEntry parent

    The IUnixDirectoryEntry of source.

    IUnixFileSystemEntry source

    The IUnixFileSystemEntry to move.

    IUnixDirectoryEntry target

    The destination IUnixDirectoryEntry where source gets moved to.

    String fileName

    The new name of source.

    CancellationToken cancellationToken

    The cancellation token.

    Returns
    Type Description
    Task<IUnixFileSystemEntry>

    Returns the new IUnixFileSystemEntry.

    | Improve this Doc View Source

    OpenReadAsync(IUnixFileEntry, Int64, CancellationToken)

    Opens a file for reading.

    Declaration
    Task<Stream> OpenReadAsync(IUnixFileEntry fileEntry, long startPosition, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    IUnixFileEntry fileEntry

    The IUnixFileEntry to read from.

    Int64 startPosition

    The start position to read from.

    CancellationToken cancellationToken

    The cancellation token.

    Returns
    Type Description
    Task<Stream>

    The Stream to be used for reading.

    | Improve this Doc View Source

    ReplaceAsync(IUnixFileEntry, Stream, CancellationToken)

    Replaces the contents of a file.

    Declaration
    Task<IBackgroundTransfer? > ReplaceAsync(IUnixFileEntry fileEntry, Stream data, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    IUnixFileEntry fileEntry

    The IUnixFileEntry to replace the data for.

    Stream data

    The data to be written to the given fileEntry.

    CancellationToken cancellationToken

    The cancellation token.

    Returns
    Type Description
    Task<Nullable<IBackgroundTransfer>>

    an optional IBackgroundTransfer when the transfer needs to happen in the background.

    | Improve this Doc View Source

    SetMacTimeAsync(IUnixFileSystemEntry, Nullable<DateTimeOffset>, Nullable<DateTimeOffset>, Nullable<DateTimeOffset>, CancellationToken)

    Sets the modify/access/create timestamp of a file system item.

    Declaration
    Task<IUnixFileSystemEntry> SetMacTimeAsync(IUnixFileSystemEntry entry, DateTimeOffset? modify, DateTimeOffset? access, DateTimeOffset? create, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    IUnixFileSystemEntry entry

    The IUnixFileSystemEntry to change the timestamp for.

    Nullable<DateTimeOffset> modify

    The modification timestamp.

    Nullable<DateTimeOffset> access

    The access timestamp.

    Nullable<DateTimeOffset> create

    The creation timestamp.

    CancellationToken cancellationToken

    The cancellation token.

    Returns
    Type Description
    Task<IUnixFileSystemEntry>

    The modified IUnixFileSystemEntry.

    | Improve this Doc View Source

    UnlinkAsync(IUnixFileSystemEntry, CancellationToken)

    Deletes a IUnixFileSystemEntry.

    Declaration
    Task UnlinkAsync(IUnixFileSystemEntry entry, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    IUnixFileSystemEntry entry

    The IUnixFileSystemEntry to delete.

    CancellationToken cancellationToken

    The cancellation token.

    Returns
    Type Description
    Task

    The task where the underlying action is performed on.

    Remarks

    An implementation might decide to move the entry into the trash instead of deleting it.

    Extension Methods

    FileSystemExtensions.GetDirectoryAsync(IUnixFileSystem, Stack<IUnixDirectoryEntry>, Nullable<String>, CancellationToken)
    FileSystemExtensions.GetDirectoryAsync(IUnixFileSystem, Stack<IUnixDirectoryEntry>, IReadOnlyList<String>, CancellationToken)
    FileSystemExtensions.SearchDirectoryAsync(IUnixFileSystem, Stack<IUnixDirectoryEntry>, Nullable<String>, CancellationToken)
    FileSystemExtensions.SearchDirectoryAsync(IUnixFileSystem, Stack<IUnixDirectoryEntry>, IReadOnlyList<String>, CancellationToken)
    FileSystemExtensions.SearchFileAsync(IUnixFileSystem, Stack<IUnixDirectoryEntry>, Nullable<String>, CancellationToken)
    FileSystemExtensions.SearchFileAsync(IUnixFileSystem, Stack<IUnixDirectoryEntry>, IReadOnlyList<String>, CancellationToken)
    FileSystemExtensions.SearchEntryAsync(IUnixFileSystem, Stack<IUnixDirectoryEntry>, Nullable<String>, CancellationToken)
    FileSystemExtensions.SearchEntryAsync(IUnixFileSystem, Stack<IUnixDirectoryEntry>, IReadOnlyList<String>, CancellationToken)
    PathSelector.SelectAsync(IUnixFileSystem, Nullable<String>, CancellationToken)
    PathSelector.SelectAsync(IUnixFileSystem, IEnumerable<IUnixDirectoryEntry>, Nullable<String>, CancellationToken)
    • Improve this Doc
    • View Source
    Back to top
    Copyright © 2018 Fubar Development Junker
    Generated by DocFX
    Creative Commons License
    FluentMigrator Documentation by FluentMigrator Project is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.