Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/Ramstack.FileSystem.Zip/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@

Provides an implementation of `Ramstack.FileSystem` based on ZIP archives.

> [!CAUTION]
> The `ZipFileSystem` is **not thread-safe** and allows reading only one file at a time, as it relies on `ZipArchive`,
> which does not support parallel read operations or simultaneous opening of multiple streams.

> [!WARNING]
> Due to this limitation, the `ZipFileSystem` class is marked as `[Obsolete]`.

> [!IMPORTANT]
> You may use `ZipFileSystem` only if you can guarantee that:
> - Only one file is open for reading at a time.
> - No file is accessed concurrently.

## Getting Started

To install the `Ramstack.FileSystem.Zip` [NuGet package](https://www.nuget.org/packages/Ramstack.FileSystem.Zip)
Expand Down
15 changes: 15 additions & 0 deletions src/Ramstack.FileSystem.Zip/ZipFileSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,21 @@ namespace Ramstack.FileSystem.Zip;
/// <summary>
/// Represents a file system backed by a ZIP archive.
/// </summary>
/// <remarks>
/// <b>WARNING:</b>
/// <para>
/// The <see cref="ZipFileSystem"/> is not thread-safe and allows reading only one file at a time, as it relies on
/// <see cref="ZipArchive"/>, which does not support parallel read operations or simultaneous opening of multiple streams.
/// </para>
/// <para>
/// You may use this class only if you can guarantee that:
/// <list type="bullet">
/// <item><description>Only one file is open for reading at a time.</description></item>
/// <item><description>No file is accessed concurrently.</description></item>
/// </list>
/// </para>
/// </remarks>
[Obsolete("Deprecated due to thread safety limitations and parallel file access capabilities.")]
public sealed class ZipFileSystem : IVirtualFileSystem
{
private readonly ZipArchive _archive;
Expand Down
Loading