Skip to content
Auto
Products

IFileSystemAsyncWriteOperations

Namespace: TagBites.IO.Operations
Assembly: TagBites.IO.dll
Product: TagBites.IO v. 2.0.0

Provides the asynchronous write operations of a FileSystem.

public interface IFileSystemAsyncWriteOperations : TagBites.IO.Operations.IFileSystemAsyncReadOperations, TagBites.IO.Operations.IFileSystemOperations

Asynchronously creates all directories and subdirectories in the specified path unless they already exist.

public virtual Task<IFileSystemStructureLinkInfo> CreateDirectoryAsync(DirectoryLink directory)

Task<IFileSystemStructureLinkInfo>

The task object representing the asynchronous operation. The value of the parameter contains the information about the link to the created directory.

Asynchronously deletes a specified directory, and optionally any subdirectories.

public virtual Task DeleteDirectoryAsync(DirectoryLink directory, bool recursive)
  • directory DirectoryLink
    The handle for the directory being deleted.
  • recursive bool
    true to remove the current directory, all its subdirectories; otherwise, false.

Task

The task object representing the asynchronous operation.

Asynchronously deletes the specified file.

public virtual Task DeleteFileAsync(FileLink file)
  • file FileLink
    The link to the file being deleted.

Task

The task object representing the asynchronous operation.

Section titled “MoveDirectoryAsync(DirectoryLink, DirectoryLink)”

Asynchronously moves a specified directory and its contents to a new location.

public virtual Task<IFileSystemStructureLinkInfo> MoveDirectoryAsync(DirectoryLink source, DirectoryLink destination)

Task<IFileSystemStructureLinkInfo>

The task object representing the asynchronous operation. The value of the parameter contains the information about the link to the moved directory.

Asynchronously moves a specified file and its contents to a new location.

public virtual Task<IFileLinkInfo> MoveFileAsync(FileLink source, FileLink destination, bool overwrite)
  • source FileLink
    The handle for the file being moved.
  • destination FileLink
    The link to the new location of .
  • overwrite bool
    true if the file can be overwritten; otherwise, if the file exists, an exception will be thrown.

Task<IFileLinkInfo>

The task object representing the asynchronous operation. The value of the parameter contains the information about the link to the moved file.

Section titled “UpdateMetadataAsync(FileSystemStructureLink, IFileSystemLinkMetadata)”

Asynchronously updates a metadata information about the file/directory.

public virtual Task<IFileSystemStructureLinkInfo> UpdateMetadataAsync(FileSystemStructureLink link, IFileSystemLinkMetadata metadata)

Task<IFileSystemStructureLinkInfo>

The task object representing the asynchronous operation. The value of the parameter contains the information about the link to the updated file/directory.

Asynchronously creates or overwrites a file in the specified handle.

public virtual Task<IFileLinkInfo> WriteFileAsync(FileLink file, Stream stream, bool overwrite)
  • file FileLink
    The handle for the file being written.
  • stream Stream
    The stream from which the contents is written to the file.
  • overwrite bool
    true if the file can be overwritten; otherwise, if the file exists, an exception will be thrown.

Task<IFileLinkInfo>

The task object representing the asynchronous operation. The value of the parameter contains the information about the link to the created or overwritten file.