Skip to content

Latest commit

 

History

History
56 lines (37 loc) · 2.14 KB

File metadata and controls

56 lines (37 loc) · 2.14 KB

LTRData.DiscUtils.Ext

Managed .NET support for reading Ext2, Ext3 and Ext4 filesystems, including file contents and filesystem metadata.

Part of the LTRData DiscUtils fork. Package IDs use LTRData.DiscUtils; C# namespaces remain DiscUtils.

Installation

dotnet add package LTRData.DiscUtils.Ext

Capabilities

Capability Support
Read files and directories Yes
Create a filesystem No
Modify an existing filesystem No

Usage notes

Includes Unix metadata and file-to-cluster/extent mapping. This is a reader, not a journal-replay, repair or formatting tool; support depends on the filesystem features used by the image.

Registration

For automatic discovery, register the providers implemented by this package:

DiscUtils.Ext.Formats.Register();

Direct use of the concrete APIs in this package does not require discovery registration. Each registration call covers only its own assembly. Register DiscUtils.Core.Formats.Register() as well when using generic disk opening through the local-file transport, and register other disk/filesystem providers as needed. These registration calls support trimming and Native AOT; this is not a guarantee for every operation in the package.

Example

using System;
using System.IO;
using DiscUtils.Ext;

// The stream starts at the filesystem, not at a whole disk's partition table.
using var stream = File.OpenRead("ext.img");
using var fs = new ExtFileSystem(stream);
foreach (var file in fs.Root.GetFiles())
    Console.WriteLine(file.FullName);

Related packages

Documentation

Repository and capability matrix · Wiki · Migration guide · Format registration and Native AOT