39 lines
2.5 KiB
C#
39 lines
2.5 KiB
C#
using System;
|
|
using System.IO;
|
|
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
using Duplicati.Proprietary.DiskImage.Partition;
|
|
|
|
namespace Duplicati.Proprietary.DiskImage.Filesystem;
|
|
|
|
/// <summary>
|
|
/// Represents an opened volume for filesystem operations.
|
|
/// </summary>
|
|
public interface IVolumeHandle : IDisposable
|
|
{
|
|
/// <summary>
|
|
/// Gets the underlying partition or raw disk.
|
|
/// </summary>
|
|
IPartition? SourcePartition { get; }
|
|
|
|
/// <summary>
|
|
/// Gets the filesystem type.
|
|
/// </summary>
|
|
string FilesystemType { get; }
|
|
|
|
/// <summary>
|
|
/// Opens a file within the volume for reading.
|
|
/// </summary>
|
|
/// <param name="path">The file path within the volume.</param>
|
|
/// <param name="cancellationToken">Cancellation token.</param>
|
|
/// <returns>Stream for reading the file.</returns>
|
|
Task<Stream> OpenFileAsync(string path, CancellationToken cancellationToken);
|
|
|
|
/// <summary>
|
|
/// Gets file metadata.
|
|
/// </summary>
|
|
/// <param name="path">The file path.</param>
|
|
/// <param name="cancellationToken">Cancellation token.</param>
|
|
/// <returns>File metadata or null.</returns>
|
|
Task<IFileMetadata?> GetFileMetadataAsync(string path, CancellationToken cancellationToken);
|
|
} |