From be4b6bcad88e2baa99b01ab70a18ac0b96aca1a5 Mon Sep 17 00:00:00 2001 From: rameel Date: Mon, 1 Sep 2025 02:32:39 +0500 Subject: [PATCH 1/2] Mark ZipFileSystem as obsolete --- src/Ramstack.FileSystem.Zip/ZipFileSystem.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/Ramstack.FileSystem.Zip/ZipFileSystem.cs b/src/Ramstack.FileSystem.Zip/ZipFileSystem.cs index 854fe80..0274e12 100644 --- a/src/Ramstack.FileSystem.Zip/ZipFileSystem.cs +++ b/src/Ramstack.FileSystem.Zip/ZipFileSystem.cs @@ -7,6 +7,21 @@ namespace Ramstack.FileSystem.Zip; /// /// Represents a file system backed by a ZIP archive. /// +/// +/// WARNING: +/// +/// The is not thread-safe and allows reading only one file at a time, as it relies on +/// , which does not support parallel read operations or simultaneous opening of multiple streams. +/// +/// +/// You may use this class only if you can guarantee that: +/// +/// Only one file is open for reading at a time. +/// No file is accessed concurrently. +/// +/// +/// +[Obsolete("Deprecated due to thread safety limitations and parallel file access capabilities.")] public sealed class ZipFileSystem : IVirtualFileSystem { private readonly ZipArchive _archive; From 8ea22ef446726946762f5fd0a57b09a2bb26becd Mon Sep 17 00:00:00 2001 From: rameel Date: Mon, 1 Sep 2025 02:33:36 +0500 Subject: [PATCH 2/2] Update README --- src/Ramstack.FileSystem.Zip/README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Ramstack.FileSystem.Zip/README.md b/src/Ramstack.FileSystem.Zip/README.md index 44c96fd..85ef7e7 100644 --- a/src/Ramstack.FileSystem.Zip/README.md +++ b/src/Ramstack.FileSystem.Zip/README.md @@ -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)