Extract file metadata for DiscUtils-based disc image formats#200
Extract file metadata for DiscUtils-based disc image formats#200
Conversation
Co-authored-by: gfs <98900+gfs@users.noreply.github.com>
- Add TryGetFileMetadata() and CollectMetadata() helpers to DiscCommon for extracting Unix permissions, UID, and GID from IUnixFileSystem-compatible file systems (Ext, Xfs, Btrfs, HfsPlus, ISO 9660 with RockRidge) - Apply metadata extraction in DiscCommon (VHD/VHDX/VMDK), IsoExtractor, UdfExtractor, and WimExtractor - Add TestDataRockRidge.iso test fixture with RockRidge extensions - Add tests for ISO metadata extraction (both with and without RockRidge) - Restore nuget.config to original configuration Co-authored-by: gfs <98900+gfs@users.noreply.github.com>
Co-authored-by: gfs <98900+gfs@users.noreply.github.com>
- Add FileAttributes and SecurityDescriptorSddl properties to FileEntryMetadata - Update DiscCommon.TryGetFileMetadata() to handle IDosFileSystem (file attributes) and IWindowsFileSystem (SDDL security descriptors) in addition to IUnixFileSystem - Update DiscCommon.CollectMetadata() to recognize Windows file systems - Add VHDX/NTFS metadata tests verifying FileAttributes and SecurityDescriptorSddl - Restore nuget.config to original configuration Co-authored-by: gfs <98900+gfs@users.noreply.github.com>
Co-authored-by: gfs <98900+gfs@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds DiscUtils-backed filesystem metadata extraction so disc image formats (ISO/UDF/VHDX/WIM) can populate FileEntry.Metadata similarly to existing archive extractors, including Windows-specific NTFS/FAT metadata.
Changes:
- Extend
FileEntryMetadatawith WindowsFileAttributesand NTFSSecurityDescriptorSddl. - Add
DiscCommon.TryGetFileMetadata()/CollectMetadata()and wire metadata into DiscUtils-based extractors. - Add/expand tests and fixtures for ISO RockRidge Unix metadata and VHDX (NTFS) Windows metadata.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| nuget.config | Normalizes XML header/format (restored feed configuration). |
| RecursiveExtractor/FileEntryMetadata.cs | Adds Windows file attributes + SDDL fields to metadata model. |
| RecursiveExtractor/Extractors/DiscCommon.cs | Implements DiscUtils metadata extraction and pre-collection helper. |
| RecursiveExtractor/Extractors/WimExtractor.cs | Sets metadata per extracted WIM entry via DiscCommon. |
| RecursiveExtractor/Extractors/IsoExtractor.cs | Pre-collects metadata while ISO FS is open and assigns to entries. |
| RecursiveExtractor/Extractors/UdfExtractor.cs | Pre-collects metadata while UDF FS is open and assigns to entries. |
| RecursiveExtractor.Tests/RecursiveExtractor.Tests.csproj | Includes new RockRidge ISO test fixture in outputs. |
| RecursiveExtractor.Tests/ExtractorTests/FileMetadataTests.cs | Adds coverage for ISO (with/without RockRidge) and VHDX NTFS metadata. |
| RecursiveExtractor.Tests/ExtractorTests/ExpectedNumFilesTests.cs | Adds expected file counts for the new RockRidge ISO fixture. |
| /// For file systems implementing <see cref="IUnixFileSystem"/> (Ext, Xfs, Btrfs, HfsPlus), | ||
| /// returns permissions, UID, and GID. | ||
| /// For file systems implementing <see cref="IDosFileSystem"/> (NTFS, FAT, WIM), | ||
| /// returns Windows file attributes. | ||
| /// For file systems implementing <see cref="IWindowsFileSystem"/> (NTFS, WIM), |
There was a problem hiding this comment.
The XML doc comment lists examples of IUnixFileSystem implementations (Ext/Xfs/Btrfs/HfsPlus) but this helper is also used for ISO via DiscUtils.Iso9660.CDReader, which implements IUnixFileSystem only when RockRidge metadata is present. Consider updating the comment to include CDReader/ISO and note the RockRidge requirement (or clarify that the list is non-exhaustive) to avoid misleading future readers.
| /// For file systems implementing <see cref="IUnixFileSystem"/> (Ext, Xfs, Btrfs, HfsPlus), | |
| /// returns permissions, UID, and GID. | |
| /// For file systems implementing <see cref="IDosFileSystem"/> (NTFS, FAT, WIM), | |
| /// returns Windows file attributes. | |
| /// For file systems implementing <see cref="IWindowsFileSystem"/> (NTFS, WIM), | |
| /// For file systems implementing <see cref="IUnixFileSystem"/> (such as Ext, Xfs, Btrfs, HfsPlus, | |
| /// and ISO images via <c>DiscUtils.Iso9660.CDReader</c> when RockRidge extensions are present), | |
| /// returns permissions, UID, and GID. | |
| /// For file systems implementing <see cref="IDosFileSystem"/> (such as NTFS, FAT, WIM), | |
| /// returns Windows file attributes. | |
| /// For file systems implementing <see cref="IWindowsFileSystem"/> (such as NTFS, WIM), |
FileAttributesproperty toFileEntryMetadatafor Windows file attributes (NTFS/FAT/WIM)SecurityDescriptorSddlproperty toFileEntryMetadatafor NTFS security descriptor in SDDL formatDiscCommon.TryGetFileMetadata()to handleIDosFileSystem(file attributes) andIWindowsFileSystem(security descriptors)DiscCommon.CollectMetadata()to recognize Windows file systemsOriginal prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.