From 6a7e0b2f10e6c0c19eb9338926ec9a158e1be5d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=B7=E3=81=93=E3=82=8B=E3=81=B5?= <86549420+puk06@users.noreply.github.com> Date: Tue, 21 Apr 2026 10:09:10 +0900 Subject: [PATCH] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- AGENTS.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/AGENTS.md b/AGENTS.md index ce2bdacc..d8bc7c85 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -127,7 +127,8 @@ SharpCompress supports multiple archive and compression formats: ### Stream Handling Rules - **Disposal**: As of version 0.21, SharpCompress **closes wrapped streams by default** (`LeaveStreamOpen = false`) - - File-based overloads (e.g., `OpenArchive(string filePath)`) use `ReaderOptions.ForFilePath` automatically + - File-based overloads (e.g., `OpenArchive(string filePath)`) open the file internally and own that stream, so it is closed by default with the archive/reader + - Do **not** rely on a specific `ReaderOptions` preset being used internally; some implementations may use `ReaderOptions.ForFilePath`, while others may use default `ReaderOptions` with the same ownership semantics - Do **not** assume every stream-based overload defaults to `ReaderOptions.ForExternalStream`; some APIs require you to pass stream ownership options explicitly - **For caller-provided streams**: Pass `ReaderOptions.ForExternalStream` or use `ReaderOptions` with `LeaveStreamOpen = true` whenever the caller must retain ownership of the stream - Example: `var options = new ReaderOptions { LeaveStreamOpen = true };`