diff --git a/TruePath.SystemIo/PathIo.cs b/TruePath.SystemIo/PathIo.cs index 25b6d0b..9844a79 100644 --- a/TruePath.SystemIo/PathIo.cs +++ b/TruePath.SystemIo/PathIo.cs @@ -1,10 +1,12 @@ // SPDX-FileCopyrightText: 2025 .NET Foundation and Contributors -// SPDX-FileCopyrightText: 2025 TruePath contributors +// SPDX-FileCopyrightText: 2025-2026 TruePath contributors // // SPDX-License-Identifier: MIT -using System.Runtime.Versioning; using System.Text; +#if NET8_0_OR_GREATER +using System.Runtime.Versioning; +#endif namespace TruePath.SystemIo; @@ -723,8 +725,15 @@ public static class PathIo /// while ?ello.txt matches only hello.txt. /// /// - /// When running on .NET Framework, a three-character extension also matches longer ones, so - /// *.txt additionally matches hello.txtt. + /// When running on .NET Framework on Windows, the pattern is also matched against the short (8.3) name of + /// each file, if it has one. Since a short name keeps at most three characters of the extension, + /// *.htm may also return index.html (whose short name is INDEX~1.HTM), and a pattern + /// such as *1* may match many files with no 1 in their long names, through the ~1 + /// suffix of their short names. Whether a file has a short name depends on the volume settings at the time + /// the file was created, so the results may differ between machines and even between files in the same + /// directory. See + /// Raymond Chen's explanation + /// for details. /// /// /// For the full pattern syntax and its caveats, see @@ -772,8 +781,15 @@ public static class PathIo /// while ?ello.txt matches only hello.txt. /// /// - /// When running on .NET Framework, a three-character extension also matches longer ones, so - /// *.txt additionally matches hello.txtt. + /// When running on .NET Framework on Windows, the pattern is also matched against the short (8.3) name of + /// each file, if it has one. Since a short name keeps at most three characters of the extension, + /// *.htm may also return index.html (whose short name is INDEX~1.HTM), and a pattern + /// such as *1* may match many files with no 1 in their long names, through the ~1 + /// suffix of their short names. Whether a file has a short name depends on the volume settings at the time + /// the file was created, so the results may differ between machines and even between files in the same + /// directory. See + /// Raymond Chen's explanation + /// for details. /// /// /// For the full pattern syntax and its caveats, see @@ -804,6 +820,16 @@ public static class PathIo /// the name, where it may also match none: a? matches both ab and a. /// /// + /// When running on .NET Framework on Windows, the pattern is also matched against the short (8.3) name of + /// each subdirectory, if it has one. So a pattern such as *1* may also return Program Files + /// (whose short name is PROGRA~1), and *.htm may return pages.html (whose short name + /// is PAGES~1.HTM). Whether a subdirectory has a short name depends on the volume settings at the time + /// it was created, so the results may differ between machines and even between subdirectories of the same + /// directory. See + /// Raymond Chen's explanation + /// for details. + /// + /// /// For the full pattern syntax and its caveats, see /// . /// @@ -843,6 +869,16 @@ public static class PathIo /// the name, where it may also match none: a? matches both ab and a. /// /// + /// When running on .NET Framework on Windows, the pattern is also matched against the short (8.3) name of + /// each subdirectory, if it has one. So a pattern such as *1* may also return Program Files + /// (whose short name is PROGRA~1), and *.htm may return pages.html (whose short name + /// is PAGES~1.HTM). Whether a subdirectory has a short name depends on the volume settings at the time + /// it was created, so the results may differ between machines and even between subdirectories of the same + /// directory. See + /// Raymond Chen's explanation + /// for details. + /// + /// /// For the full pattern syntax and its caveats, see /// . /// @@ -876,8 +912,15 @@ public static IEnumerable EnumerateFiles(this AbsolutePath path) /// while ?ello.txt matches only hello.txt. /// /// - /// When running on .NET Framework, a three-character extension also matches longer ones, so - /// *.txt additionally matches hello.txtt. + /// When running on .NET Framework on Windows, the pattern is also matched against the short (8.3) name of + /// each file, if it has one. Since a short name keeps at most three characters of the extension, + /// *.htm may also return index.html (whose short name is INDEX~1.HTM), and a pattern + /// such as *1* may match many files with no 1 in their long names, through the ~1 + /// suffix of their short names. Whether a file has a short name depends on the volume settings at the time + /// the file was created, so the results may differ between machines and even between files in the same + /// directory. See + /// Raymond Chen's explanation + /// for details. /// /// /// For the full pattern syntax and its caveats, see @@ -928,8 +971,15 @@ public static IEnumerable EnumerateFiles(this AbsolutePath path, s /// while ?ello.txt matches only hello.txt. /// /// - /// When running on .NET Framework, a three-character extension also matches longer ones, so - /// *.txt additionally matches hello.txtt. + /// When running on .NET Framework on Windows, the pattern is also matched against the short (8.3) name of + /// each file, if it has one. Since a short name keeps at most three characters of the extension, + /// *.htm may also return index.html (whose short name is INDEX~1.HTM), and a pattern + /// such as *1* may match many files with no 1 in their long names, through the ~1 + /// suffix of their short names. Whether a file has a short name depends on the volume settings at the time + /// the file was created, so the results may differ between machines and even between files in the same + /// directory. See + /// Raymond Chen's explanation + /// for details. /// /// /// For the full pattern syntax and its caveats, see