From 75b007cfe4f2d655b579a33941a6296baa8d7169 Mon Sep 17 00:00:00 2001 From: pkazakov-dev Date: Mon, 9 Feb 2026 23:15:09 +0500 Subject: [PATCH 1/3] path.EnumerateFiles --- TruePath.SystemIo/PathIo.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/TruePath.SystemIo/PathIo.cs b/TruePath.SystemIo/PathIo.cs index 5aad759..60f9db5 100644 --- a/TruePath.SystemIo/PathIo.cs +++ b/TruePath.SystemIo/PathIo.cs @@ -709,6 +709,13 @@ public static class PathIo /// An array of the full names (including paths) for the files in the specified directory that match the specified search pattern. public static string[] GetFiles(this AbsolutePath path) => Directory.GetFiles(path.Value); + + public static IEnumerable EnumerateFiles(this AbsolutePath path) + { + return Directory.EnumerateFiles(path.Value) + .Select(filename => path / filename); + } + /// /// Returns the names of files (including their paths) that match the specified search pattern in the specified directory. /// @@ -717,6 +724,12 @@ public static class PathIo /// An array of the full names (including paths) for the files in the specified directory that match the specified search pattern. public static string[] GetFiles(this AbsolutePath path, string searchPattern) => Directory.GetFiles(path.Value, searchPattern); + public static IEnumerable EnumerateFiles(this AbsolutePath path, string searchPattern) + { + return Directory.EnumerateFiles(path.Value, searchPattern) + .Select(filename => path / filename); + } + #if NET8_0_OR_GREATER /// /// Returns the names of files (including their paths) that match the specified search pattern and enumeration options in the specified directory. @@ -737,6 +750,12 @@ public static class PathIo /// An array of the full names (including paths) for the files in the specified directory that match the specified search pattern and option. public static string[] GetFiles(this AbsolutePath path, string searchPattern, SearchOption searchOption) => Directory.GetFiles(path.Value, searchPattern, searchOption); + public static IEnumerable EnumerateFiles(this AbsolutePath path, string searchPattern, SearchOption searchOption) + { + return Directory.EnumerateFiles(path.Value, searchPattern, searchOption) + .Select(filename => path / filename); + } + /// /// Returns the names of subdirectories (including their paths) in the specified directory. /// From 1b5aea8ef8e311c7780f5f1a24df3c6defb885a6 Mon Sep 17 00:00:00 2001 From: pkazakov-dev Date: Tue, 10 Feb 2026 00:04:20 +0500 Subject: [PATCH 2/3] Add PathIo.EnumerateFiles extensions --- TruePath.SystemIo/PathIo.cs | 72 +++++++++++++++++++++++++++---------- 1 file changed, 53 insertions(+), 19 deletions(-) diff --git a/TruePath.SystemIo/PathIo.cs b/TruePath.SystemIo/PathIo.cs index 60f9db5..024002d 100644 --- a/TruePath.SystemIo/PathIo.cs +++ b/TruePath.SystemIo/PathIo.cs @@ -709,13 +709,6 @@ public static class PathIo /// An array of the full names (including paths) for the files in the specified directory that match the specified search pattern. public static string[] GetFiles(this AbsolutePath path) => Directory.GetFiles(path.Value); - - public static IEnumerable EnumerateFiles(this AbsolutePath path) - { - return Directory.EnumerateFiles(path.Value) - .Select(filename => path / filename); - } - /// /// Returns the names of files (including their paths) that match the specified search pattern in the specified directory. /// @@ -724,12 +717,6 @@ public static IEnumerable EnumerateFiles(this AbsolutePath path) /// An array of the full names (including paths) for the files in the specified directory that match the specified search pattern. public static string[] GetFiles(this AbsolutePath path, string searchPattern) => Directory.GetFiles(path.Value, searchPattern); - public static IEnumerable EnumerateFiles(this AbsolutePath path, string searchPattern) - { - return Directory.EnumerateFiles(path.Value, searchPattern) - .Select(filename => path / filename); - } - #if NET8_0_OR_GREATER /// /// Returns the names of files (including their paths) that match the specified search pattern and enumeration options in the specified directory. @@ -750,12 +737,6 @@ public static IEnumerable EnumerateFiles(this AbsolutePath path, s /// An array of the full names (including paths) for the files in the specified directory that match the specified search pattern and option. public static string[] GetFiles(this AbsolutePath path, string searchPattern, SearchOption searchOption) => Directory.GetFiles(path.Value, searchPattern, searchOption); - public static IEnumerable EnumerateFiles(this AbsolutePath path, string searchPattern, SearchOption searchOption) - { - return Directory.EnumerateFiles(path.Value, searchPattern, searchOption) - .Select(filename => path / filename); - } - /// /// Returns the names of subdirectories (including their paths) in the specified directory. /// @@ -790,4 +771,57 @@ public static IEnumerable EnumerateFiles(this AbsolutePath path, s /// One of the enumeration values that specifies whether the search operation should include only the current directory or should include all subdirectories. /// An array of the full names (including paths) for the subdirectories in the specified directory that match the specified search pattern and option. public static string[] GetDirectories(this AbsolutePath path, string searchPattern, SearchOption searchOption) => Directory.GetDirectories(path.Value, searchPattern, searchOption); + + /// + /// Returns an enumerable collection of of full file names in a specified path. + /// + /// The directory to search. + /// An enumerable collection of of the full names (including paths) for the files in the specified directory that match the specified search pattern. + public static IEnumerable EnumerateFiles(this AbsolutePath path) + { + return Directory.EnumerateFiles(path.Value) + .Select(filename => path / filename); + } + + /// + /// Returns an enumerable collection of of full file names in a specified path. + /// + /// The directory to search. + /// The search string to match against the names of files in . + /// An enumerable collection of of the full names (including paths) for the files in the specified directory that match the specified search pattern. + public static IEnumerable EnumerateFiles(this AbsolutePath path, string searchPattern) + { + return Directory.EnumerateFiles(path.Value, searchPattern) + .Select(filename => path / filename); + } + + public static string[] GetFiles(this AbsolutePath path, string searchPattern, EnumerationOptions enumerationOptions) => Directory.GetFiles(path.Value, searchPattern, enumerationOptions); + +#if NET8_0_OR_GREATER + /// + /// Returns an enumerable collection of of the names of files (including their paths) that match the specified search pattern and enumeration options in the specified directory. + /// + /// The directory to search. + /// The search string to match against the names of files in . + /// An object that contains the search options to use. + /// An enumerable collection of of the full names (including paths) for the files in the specified directory that match the specified search pattern and enumeration options. + public static IEnumerable EnumerateFiles(this AbsolutePath path, string searchPattern, EnumerationOptions enumerationOptions) + { + return Directory.EnumerateFiles(path.Value, searchPattern, enumerationOptions) + .Select(filename => path / filename); + } +#endif + + /// + /// Returns an enumerable collection of with the names of files (including their paths) that match the specified search pattern in the specified directory, using a value to determine whether to search subdirectories. + /// + /// The directory to search. + /// The search string to match against the names of files in . + /// One of the enumeration values that specifies whether the search operation should include only the current directory or should include all subdirectories. + /// An enumerable collection of of the full names (including paths) for the files in the specified directory that match the specified search pattern. + public static IEnumerable EnumerateFiles(this AbsolutePath path, string searchPattern, SearchOption searchOption) + { + return Directory.EnumerateFiles(path.Value, searchPattern, searchOption) + .Select(filename => path / filename); + } } From 322f337a385f28f3e90f33e4a740662be30cf4e5 Mon Sep 17 00:00:00 2001 From: pkazakov-dev Date: Tue, 10 Feb 2026 00:53:35 +0500 Subject: [PATCH 3/3] Cleanup --- TruePath.SystemIo/PathIo.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/TruePath.SystemIo/PathIo.cs b/TruePath.SystemIo/PathIo.cs index 024002d..1f96286 100644 --- a/TruePath.SystemIo/PathIo.cs +++ b/TruePath.SystemIo/PathIo.cs @@ -795,8 +795,6 @@ public static IEnumerable EnumerateFiles(this AbsolutePath path, s .Select(filename => path / filename); } - public static string[] GetFiles(this AbsolutePath path, string searchPattern, EnumerationOptions enumerationOptions) => Directory.GetFiles(path.Value, searchPattern, enumerationOptions); - #if NET8_0_OR_GREATER /// /// Returns an enumerable collection of of the names of files (including their paths) that match the specified search pattern and enumeration options in the specified directory.