29 Commits

Author SHA1 Message Date
Matt Nadareski
70e6bdd41c Add .NET 11 support 2026-11-11 10:29:50 +01:00
gmipf
6dddf7db37 Do not follow linked directories in SafeGetFiles outside of Windows (#8)
* Do not follow linked directories in SafeGetFiles outside of Windows

SafeGetFiles with SearchOption.AllDirectories follows directory symlinks.
On Linux, the UDF view of some PC/Mac hybrid discs has symlinks whose
target reads as empty, and each one resolves to its own folder, so the
recursion never ends (fixes #2, SabreTools/BinaryObjectScanner#276).

Outside of Windows, walk the tree one directory at a time and do not enter
directories that carry FileAttributes.ReparsePoint. Files are matched with
Directory.GetFiles per directory, so the pattern behaves as before, and the
order is the same breadth-first order. Windows keeps Directory.GetFiles.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Do not follow linked directories in the other AllDirectories overloads

SafeGetDirectories and the SafeEnumerateDirectories, SafeEnumerateFiles
and SafeEnumerateFileSystemEntries wrappers follow directory symlinks in
the same way. On Linux, with one directory linked to itself,
SafeEnumerateFiles returns 43 files instead of 2, and with three such
links it is still running after 10 seconds.

The walk from SafeGetFiles is now a lazy iterator that all of them share,
so the Enumerate wrappers stay lazy. Each directory is listed with the
matching overload without SearchOption (Directory.GetFiles,
SafeEnumerateFiles and so on), so patterns and inaccessible directories
behave as in the recursive search. If the attributes of a subdirectory
cannot be read, such as below a directory without execute permission, it
is entered anyway, so it fails in the same way as in the recursive search.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Check for linked directories without catching exceptions

DirectoryInfo.Exists returns false where the attributes cannot be read, and the criteria for the walk are checked one at a time with their reasons.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 13:52:11 +01:00
Matt Nadareski
9e25afe28b Simplify remaining device extensions tests 2026-11-02 08:46:06 -05:00
Matt Nadareski
e01891e779 Reduce surface area of tests and issues in device extensions 2026-11-02 08:05:15 -05:00
Matt Nadareski
1b1bea3a17 Separate out device extensions 2026-11-02 07:43:13 -05:00
Matt Nadareski
115cbf3f2b Update packages 2026-10-12 09:47:53 -04:00
Matt Nadareski
0b9c4559a1 Update packages 2026-08-20 11:40:02 -04:00
Matt Nadareski
c60f45073d Fix some tests that broke last minute 2026-07-09 15:58:03 -04:00
Matt Nadareski
486c95582f Port *nix device methods, update tests 2026-07-09 15:45:00 -04:00
Matt Nadareski
871422ad23 Update test packages 2026-07-09 09:39:09 -04:00
Matt Nadareski
9281796251 ResolvePath should always return an aboslute path 2026-07-02 10:21:15 -04:00
Matt Nadareski
a893de700a Add ResolvePath extension from MPF 2026-07-02 10:01:18 -04:00
Matt Nadareski
edc4f5e6d4 Update packages 2026-05-12 22:50:23 -04:00
Matt Nadareski
574eebb231 Fix namespace that slipped by 2026-04-20 11:09:29 -04:00
Matt Nadareski
b7676f9306 Move last Transform functionality to IO.Extensions 2026-03-24 10:12:38 -04:00
Matt Nadareski
6307b9c361 Concatenate to IOExtensions 2026-03-24 09:57:40 -04:00
Matt Nadareski
6885198fcf SplitToEvenOdd to a stream extension 2026-03-24 09:53:19 -04:00
Matt Nadareski
3d4ebd4314 Migrate some Transform tasks to extensions appropriately 2026-03-24 09:05:23 -04:00
Matt Nadareski
99c318a9ae Add BlockCopy extension, finally 2026-03-23 20:47:49 -04:00
Matt Nadareski
77dc8ebed7 Separate out collections extensions
Even though there are relatively few collections extensions right now, there is a relatively high chance that other extension will be used in the future.
2026-03-23 10:50:09 -04:00
Matt Nadareski
1f1a5c51f3 Port GetFileSize method from BOS 2026-03-22 17:17:13 -04:00
Matt Nadareski
86040947b5 Combine ParentablePathExtensions into IO extensions and sort 2026-03-22 15:35:11 -04:00
Matt Nadareski
34ed3322c4 Move some math/numeric byte array extensions 2026-03-22 15:22:46 -04:00
Matt Nadareski
190e593883 Move some matching extensions to Matching namespace 2026-03-21 22:09:56 -04:00
Matt Nadareski
5b2338aa6f Move more string-related extensions 2026-03-21 21:59:14 -04:00
Matt Nadareski
6dc531dad7 Start parting out IO.Extensions a bit more 2026-03-21 21:45:14 -04:00
Matt Nadareski
add545ec55 Numerics extensions to new namespace 2026-03-21 20:57:03 -04:00
Matt Nadareski
bbd48926f1 Project file cleanup 2026-03-21 14:23:13 -04:00
Matt Nadareski
d614379cf5 Libraries
This change looks dramatic, but it's just separating out the already-split namespaces into separate top-level folders. In theory, every single one could be built into their own Nuget package. `SabreTools.IO.Meta` builds the normal Nuget package that is used by all other projects and includes all namespaces. `SabreTools.IO` builds to `SabreTools.IO.Common` to avoid overwriting issues on publish.
2026-03-21 13:55:42 -04:00