From 06dde95ac0a22db3e9a19fdf89cc2ede9a120c22 Mon Sep 17 00:00:00 2001 From: konard Date: Sat, 13 Sep 2025 18:00:59 +0300 Subject: [PATCH 1/3] Initial commit with task details for issue #53 Adding CLAUDE.md with task information for AI processing. This file will be removed when the task is complete. Issue: https://github.com/linksplatform/IO/issues/53 --- CLAUDE.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 CLAUDE.md diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..e3fb15f --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,5 @@ +Issue to solve: https://github.com/linksplatform/IO/issues/53 +Your prepared branch: issue-53-2cc54528 +Your prepared working directory: /tmp/gh-issue-solver-1757775656448 + +Proceed. \ No newline at end of file From 4bec5306886103744460359a88f3637823384f96 Mon Sep 17 00:00:00 2001 From: konard Date: Sat, 13 Sep 2025 18:04:32 +0300 Subject: [PATCH 2/3] Rename DeleteAll method to DeleteFiles MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Renamed DeleteAll method to DeleteFiles in both C# and C++ implementations - Updated all three overloads of the method in FileHelpers - Added comprehensive tests for the renamed method functionality - Verified both specific pattern matching and default wildcard behavior This change improves method naming clarity as the method specifically deletes files from directories rather than all types of entities. πŸ€– Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- cpp/Platform.IO/FileHelpers.h | 6 ++-- csharp/Platform.IO.Tests/FileHelpersTests.cs | 32 ++++++++++++++++++++ csharp/Platform.IO/FileHelpers.cs | 6 ++-- 3 files changed, 38 insertions(+), 6 deletions(-) diff --git a/cpp/Platform.IO/FileHelpers.h b/cpp/Platform.IO/FileHelpers.h index e9401ba..e8f7633 100644 --- a/cpp/Platform.IO/FileHelpers.h +++ b/cpp/Platform.IO/FileHelpers.h @@ -69,11 +69,11 @@ } } - public: static void DeleteAll(std::string directory) { DeleteAll(directory, "*"); } + public: static void DeleteFiles(std::string directory) { DeleteFiles(directory, "*"); } - public: static void DeleteAll(std::string directory, std::string searchPattern) { DeleteAll(directory, searchPattern, SearchOption.TopDirectoryOnly); } + public: static void DeleteFiles(std::string directory, std::string searchPattern) { DeleteFiles(directory, searchPattern, SearchOption.TopDirectoryOnly); } - public: static void DeleteAll(std::string directory, std::string searchPattern, SearchOption searchOption) + public: static void DeleteFiles(std::string directory, std::string searchPattern, SearchOption searchOption) { foreach (auto file in Directory.EnumerateFiles(directory, searchPattern, searchOption)) { diff --git a/csharp/Platform.IO.Tests/FileHelpersTests.cs b/csharp/Platform.IO.Tests/FileHelpersTests.cs index 3bdba03..d7486de 100644 --- a/csharp/Platform.IO.Tests/FileHelpersTests.cs +++ b/csharp/Platform.IO.Tests/FileHelpersTests.cs @@ -1,3 +1,4 @@ +using System; using System.IO; using Xunit; @@ -15,5 +16,36 @@ public void WriteReadTest() Assert.Equal(readValue, originalValue); File.Delete(temporaryFile); } + + [Fact] + public void DeleteFilesTest() + { + var tempDir = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); + Directory.CreateDirectory(tempDir); + + var testFile1 = Path.Combine(tempDir, "test1.txt"); + var testFile2 = Path.Combine(tempDir, "test2.txt"); + var testFile3 = Path.Combine(tempDir, "test3.log"); + + File.WriteAllText(testFile1, "test content"); + File.WriteAllText(testFile2, "test content"); + File.WriteAllText(testFile3, "test content"); + + Assert.True(File.Exists(testFile1)); + Assert.True(File.Exists(testFile2)); + Assert.True(File.Exists(testFile3)); + + FileHelpers.DeleteFiles(tempDir, "*.txt"); + + Assert.False(File.Exists(testFile1)); + Assert.False(File.Exists(testFile2)); + Assert.True(File.Exists(testFile3)); + + FileHelpers.DeleteFiles(tempDir); + + Assert.False(File.Exists(testFile3)); + + Directory.Delete(tempDir); + } } } diff --git a/csharp/Platform.IO/FileHelpers.cs b/csharp/Platform.IO/FileHelpers.cs index fd412a3..5217c98 100644 --- a/csharp/Platform.IO/FileHelpers.cs +++ b/csharp/Platform.IO/FileHelpers.cs @@ -207,7 +207,7 @@ public static void SetSize(string path, long size) /// ΠŸΡƒΡ‚ΡŒ ΠΊ Π΄ΠΈΡ€Π΅ΠΊΡ‚ΠΎΡ€ΠΈΠΈ для очистки. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static void DeleteAll(string directory) => DeleteAll(directory, "*"); + public static void DeleteFiles(string directory) => DeleteFiles(directory, "*"); /// /// Removes files from the directory at the path according to the . @@ -222,7 +222,7 @@ public static void SetSize(string path, long size) /// Π¨Π°Π±Π»ΠΎΠ½ поиска для удаляСмых Ρ„Π°ΠΉΠ»ΠΎΠ² Π² Π΄ΠΈΡ€Π΅ΠΊΡ‚ΠΎΡ€ΠΈΠΈ находящСйся ΠΏΠΎ ΠΏΡƒΡ‚ΠΈ . /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static void DeleteAll(string directory, string searchPattern) => DeleteAll(directory, searchPattern, SearchOption.TopDirectoryOnly); + public static void DeleteFiles(string directory, string searchPattern) => DeleteFiles(directory, searchPattern, SearchOption.TopDirectoryOnly); /// /// Removes files from the directory at the path according to the and the . @@ -241,7 +241,7 @@ public static void SetSize(string path, long size) /// Π—Π½Π°Ρ‡Π΅Π½ΠΈΠ΅ ΠΎΠΏΡ€Π΅Π΄Π΅Π»ΡΡŽΡ‰Π΅Π΅ ΠΈΡΠΊΠ°Ρ‚ΡŒ Π»ΠΈ Ρ‚ΠΎΠ»ΡŒΠΊΠΎ Π² Ρ‚Π΅ΠΊΡƒΡ‰Π΅ΠΉ Π΄ΠΈΡ€Π΅ΠΊΡ‚ΠΎΡ€ΠΈΠΈ находящСйся ΠΏΠΎ ΠΏΡƒΡ‚ΠΈ , ΠΈΠ»ΠΈ Ρ‚Π°ΠΊΠΆΠ΅ Π²ΠΎ всСх субдирСкториях. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static void DeleteAll(string directory, string searchPattern, SearchOption searchOption) + public static void DeleteFiles(string directory, string searchPattern, SearchOption searchOption) { foreach (var file in Directory.EnumerateFiles(directory, searchPattern, searchOption)) { From 80aa8643390636e2cf6a76217adb5d675ab6d702 Mon Sep 17 00:00:00 2001 From: konard Date: Sat, 13 Sep 2025 18:05:07 +0300 Subject: [PATCH 3/3] Remove CLAUDE.md - Claude command completed --- CLAUDE.md | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 CLAUDE.md diff --git a/CLAUDE.md b/CLAUDE.md deleted file mode 100644 index e3fb15f..0000000 --- a/CLAUDE.md +++ /dev/null @@ -1,5 +0,0 @@ -Issue to solve: https://github.com/linksplatform/IO/issues/53 -Your prepared branch: issue-53-2cc54528 -Your prepared working directory: /tmp/gh-issue-solver-1757775656448 - -Proceed. \ No newline at end of file