LTRData.DiscUtils
1.0.32
See the version list below for details.
dotnet add package LTRData.DiscUtils --version 1.0.32
NuGet\Install-Package LTRData.DiscUtils -Version 1.0.32
<PackageReference Include="LTRData.DiscUtils" Version="1.0.32" />
paket add LTRData.DiscUtils --version 1.0.32
#r "nuget: LTRData.DiscUtils, 1.0.32"
// Install LTRData.DiscUtils as a Cake Addin #addin nuget:?package=LTRData.DiscUtils&version=1.0.32 // Install LTRData.DiscUtils as a Cake Tool #tool nuget:?package=LTRData.DiscUtils&version=1.0.32
Project Description
DiscUtils is a .NET library to read and write ISO files and Virtual Machine disk files (VHD, VDI, XVA, VMDK, etc). DiscUtils is developed in C# with no native code (or P/Invoke).
This fork
This is https://github.com/LTRData/DiscUtils
This is a fork of https://github.com/DiscUtils/DiscUtils, a fork of https://github.com/quamotion/DiscUtils, which is a fork of https://discutils.codeplex.com/.
This fork has the primary goal of modernized and optimized code, better compatibility with non-Windows platforms and much better performance at the cost of dropping support for older .NET Framework versions and some breaking interface changes compared to upstream DiscUtils. For example, there is support for async
and Span<byte>
versions of read and write on Stream
objects throughout all I/O paths and methods for enumerating files in directories return IEnumerable
objects instead of building temporary lists and arrays.
All libraries target .NET Framework 4.6 and 4.8, .NET Standard 2.0 and 2.1 as well as .NET 6.0 and 7.0.
Implementation status
Implementations of the ISO, UDF, FAT and NTFS file systems are fairly stable. Lots of work have been carried out to solve issues with Ext2/3/4, SquashFs and Btrfs implementations, but there are probably a few bugs left. It is also possible to open TAR and ZIP archives as file systems. VHD, XVA, VMDK and VDI disk formats are implemented, as well as read/write Registry support. Support for pending updates in Registry log files is also implemented. The library also includes a simple iSCSI initiator, for accessing disks via iSCSI and an NFS client implementation.
Wiki
See more up to date documentation at the Wiki
Implementation in this repository
The DiscUtils library has been split into 25 independent projects, which can function without the others present. This reduces the "cost" of having DiscUtils immensely, as we're down from the 1 MB binary it used to be.
To work with this, four Meta packages have been created:
- DiscUtils.Complete: Everything, like before
- DiscUtils.Containers: such as VMDK, VHD, VHDX
- DiscUtils.FileSystems: such as NTFS, FAT, EXT
- DiscUtils.Transports: such as NFS
Note on detections
DiscUtils has a number of detection helpers. These provide services like "which filesystem is this stream?". For this to work, you must register your filesystem providers with the DiscUtils core. To do this, call:
DiscUtils.Setup.RegisterAssembly(assembly);
Where assembly
is the assembly you wish to register. Note that the metapackages have helpers:
SetupHelper.SetupComplete(); // From DiscUtils.Complete
SetupHelper.SetupContainers(); // From DiscUtils.Containers
SetupHelper.SetupFileSystems(); // From DiscUtils.FileSystems
SetupHelper.SetupTransports(); // From DiscUtils.Transports
How to use the Library
Here's a few really simple examples.
How to create a new ISO:
CDBuilder builder = new CDBuilder();
builder.UseJoliet = true;
builder.VolumeIdentifier = "A_SAMPLE_DISK";
builder.AddFile(@"Folder\Hello.txt", Encoding.ASCII.GetBytes("Hello World!"));
builder.Build(@"C:\temp\sample.iso");
You can add files as byte arrays (shown above), as files from the Windows filesystem, or as a Stream. By using a different form of Build, you can get a Stream to the ISO file, rather than writing it to the Windows filesystem.
How to extract a file from an ISO:
using (FileStream isoStream = File.Open(@"C:\temp\sample.iso"))
{
CDReader cd = new CDReader(isoStream, true);
Stream fileStream = cd.OpenFile(@"Folder\Hello.txt", FileMode.Open);
// Use fileStream...
}
You can also browse through the directory hierarchy, starting at cd.Root.
How to create a virtual hard disk:
long diskSize = 30 * 1024 * 1024; //30MB
using (Stream vhdStream = File.Create(@"C:\TEMP\mydisk.vhd"))
{
Disk disk = Disk.InitializeDynamic(vhdStream, diskSize);
BiosPartitionTable.Initialize(disk, WellKnownPartitionType.WindowsFat);
using (FatFileSystem fs = FatFileSystem.FormatPartition(disk, 0, null))
{
fs.CreateDirectory(@"TestDir\CHILD");
// do other things with the file system...
}
}
As with ISOs, you can browse the file system, starting at fs.Root.
How to create a virtual floppy disk:
using (FileStream fs = File.Create(@"myfloppy.vfd"))
{
using (FatFileSystem floppy = FatFileSystem.FormatFloppy(fs, FloppyDiskType.HighDensity, "MY FLOPPY "))
{
using (Stream s = floppy.OpenFile("foo.txt", FileMode.Create))
{
// Use stream...
}
}
}
Again, start browsing the file system at floppy.Root.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
.NET Framework | net46 is compatible. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 is compatible. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.6
- LTRData.DiscUtils.BootConfig (>= 1.0.32)
- LTRData.DiscUtils.Btrfs (>= 1.0.32)
- LTRData.DiscUtils.Core (>= 1.0.32)
- LTRData.DiscUtils.Dmg (>= 1.0.32)
- LTRData.DiscUtils.Ext (>= 1.0.32)
- LTRData.DiscUtils.Fat (>= 1.0.32)
- LTRData.DiscUtils.HfsPlus (>= 1.0.32)
- LTRData.DiscUtils.Iscsi (>= 1.0.32)
- LTRData.DiscUtils.Iso9660 (>= 1.0.32)
- LTRData.DiscUtils.Lvm (>= 1.0.32)
- LTRData.DiscUtils.Net (>= 1.0.32)
- LTRData.DiscUtils.Nfs (>= 1.0.32)
- LTRData.DiscUtils.Ntfs (>= 1.0.32)
- LTRData.DiscUtils.OpticalDiscSharing (>= 1.0.32)
- LTRData.DiscUtils.OpticalDisk (>= 1.0.32)
- LTRData.DiscUtils.Registry (>= 1.0.32)
- LTRData.DiscUtils.Sdi (>= 1.0.32)
- LTRData.DiscUtils.SquashFs (>= 1.0.32)
- LTRData.DiscUtils.Swap (>= 1.0.32)
- LTRData.DiscUtils.Udf (>= 1.0.32)
- LTRData.DiscUtils.Vdi (>= 1.0.32)
- LTRData.DiscUtils.Vhd (>= 1.0.32)
- LTRData.DiscUtils.Vhdx (>= 1.0.32)
- LTRData.DiscUtils.VirtualFileSystem (>= 1.0.32)
- LTRData.DiscUtils.Vmdk (>= 1.0.32)
- LTRData.DiscUtils.Wim (>= 1.0.32)
- LTRData.DiscUtils.Xfs (>= 1.0.32)
- LTRData.DiscUtils.Xva (>= 1.0.32)
-
.NETFramework 4.8
- LTRData.DiscUtils.BootConfig (>= 1.0.32)
- LTRData.DiscUtils.Btrfs (>= 1.0.32)
- LTRData.DiscUtils.Core (>= 1.0.32)
- LTRData.DiscUtils.Dmg (>= 1.0.32)
- LTRData.DiscUtils.Ext (>= 1.0.32)
- LTRData.DiscUtils.Fat (>= 1.0.32)
- LTRData.DiscUtils.HfsPlus (>= 1.0.32)
- LTRData.DiscUtils.Iscsi (>= 1.0.32)
- LTRData.DiscUtils.Iso9660 (>= 1.0.32)
- LTRData.DiscUtils.Lvm (>= 1.0.32)
- LTRData.DiscUtils.Net (>= 1.0.32)
- LTRData.DiscUtils.Nfs (>= 1.0.32)
- LTRData.DiscUtils.Ntfs (>= 1.0.32)
- LTRData.DiscUtils.OpticalDiscSharing (>= 1.0.32)
- LTRData.DiscUtils.OpticalDisk (>= 1.0.32)
- LTRData.DiscUtils.Registry (>= 1.0.32)
- LTRData.DiscUtils.Sdi (>= 1.0.32)
- LTRData.DiscUtils.SquashFs (>= 1.0.32)
- LTRData.DiscUtils.Swap (>= 1.0.32)
- LTRData.DiscUtils.Udf (>= 1.0.32)
- LTRData.DiscUtils.Vdi (>= 1.0.32)
- LTRData.DiscUtils.Vhd (>= 1.0.32)
- LTRData.DiscUtils.Vhdx (>= 1.0.32)
- LTRData.DiscUtils.VirtualFileSystem (>= 1.0.32)
- LTRData.DiscUtils.Vmdk (>= 1.0.32)
- LTRData.DiscUtils.Wim (>= 1.0.32)
- LTRData.DiscUtils.Xfs (>= 1.0.32)
- LTRData.DiscUtils.Xva (>= 1.0.32)
-
.NETStandard 2.0
- LTRData.DiscUtils.BootConfig (>= 1.0.32)
- LTRData.DiscUtils.Btrfs (>= 1.0.32)
- LTRData.DiscUtils.Core (>= 1.0.32)
- LTRData.DiscUtils.Dmg (>= 1.0.32)
- LTRData.DiscUtils.Ext (>= 1.0.32)
- LTRData.DiscUtils.Fat (>= 1.0.32)
- LTRData.DiscUtils.HfsPlus (>= 1.0.32)
- LTRData.DiscUtils.Iscsi (>= 1.0.32)
- LTRData.DiscUtils.Iso9660 (>= 1.0.32)
- LTRData.DiscUtils.Lvm (>= 1.0.32)
- LTRData.DiscUtils.Net (>= 1.0.32)
- LTRData.DiscUtils.Nfs (>= 1.0.32)
- LTRData.DiscUtils.Ntfs (>= 1.0.32)
- LTRData.DiscUtils.OpticalDiscSharing (>= 1.0.32)
- LTRData.DiscUtils.OpticalDisk (>= 1.0.32)
- LTRData.DiscUtils.Registry (>= 1.0.32)
- LTRData.DiscUtils.Sdi (>= 1.0.32)
- LTRData.DiscUtils.SquashFs (>= 1.0.32)
- LTRData.DiscUtils.Swap (>= 1.0.32)
- LTRData.DiscUtils.Udf (>= 1.0.32)
- LTRData.DiscUtils.Vdi (>= 1.0.32)
- LTRData.DiscUtils.Vhd (>= 1.0.32)
- LTRData.DiscUtils.Vhdx (>= 1.0.32)
- LTRData.DiscUtils.VirtualFileSystem (>= 1.0.32)
- LTRData.DiscUtils.Vmdk (>= 1.0.32)
- LTRData.DiscUtils.Wim (>= 1.0.32)
- LTRData.DiscUtils.Xfs (>= 1.0.32)
- LTRData.DiscUtils.Xva (>= 1.0.32)
-
.NETStandard 2.1
- LTRData.DiscUtils.BootConfig (>= 1.0.32)
- LTRData.DiscUtils.Btrfs (>= 1.0.32)
- LTRData.DiscUtils.Core (>= 1.0.32)
- LTRData.DiscUtils.Dmg (>= 1.0.32)
- LTRData.DiscUtils.Ext (>= 1.0.32)
- LTRData.DiscUtils.Fat (>= 1.0.32)
- LTRData.DiscUtils.HfsPlus (>= 1.0.32)
- LTRData.DiscUtils.Iscsi (>= 1.0.32)
- LTRData.DiscUtils.Iso9660 (>= 1.0.32)
- LTRData.DiscUtils.Lvm (>= 1.0.32)
- LTRData.DiscUtils.Net (>= 1.0.32)
- LTRData.DiscUtils.Nfs (>= 1.0.32)
- LTRData.DiscUtils.Ntfs (>= 1.0.32)
- LTRData.DiscUtils.OpticalDiscSharing (>= 1.0.32)
- LTRData.DiscUtils.OpticalDisk (>= 1.0.32)
- LTRData.DiscUtils.Registry (>= 1.0.32)
- LTRData.DiscUtils.Sdi (>= 1.0.32)
- LTRData.DiscUtils.SquashFs (>= 1.0.32)
- LTRData.DiscUtils.Swap (>= 1.0.32)
- LTRData.DiscUtils.Udf (>= 1.0.32)
- LTRData.DiscUtils.Vdi (>= 1.0.32)
- LTRData.DiscUtils.Vhd (>= 1.0.32)
- LTRData.DiscUtils.Vhdx (>= 1.0.32)
- LTRData.DiscUtils.VirtualFileSystem (>= 1.0.32)
- LTRData.DiscUtils.Vmdk (>= 1.0.32)
- LTRData.DiscUtils.Wim (>= 1.0.32)
- LTRData.DiscUtils.Xfs (>= 1.0.32)
- LTRData.DiscUtils.Xva (>= 1.0.32)
-
net6.0
- LTRData.DiscUtils.BootConfig (>= 1.0.32)
- LTRData.DiscUtils.Btrfs (>= 1.0.32)
- LTRData.DiscUtils.Core (>= 1.0.32)
- LTRData.DiscUtils.Dmg (>= 1.0.32)
- LTRData.DiscUtils.Ext (>= 1.0.32)
- LTRData.DiscUtils.Fat (>= 1.0.32)
- LTRData.DiscUtils.HfsPlus (>= 1.0.32)
- LTRData.DiscUtils.Iscsi (>= 1.0.32)
- LTRData.DiscUtils.Iso9660 (>= 1.0.32)
- LTRData.DiscUtils.Lvm (>= 1.0.32)
- LTRData.DiscUtils.Net (>= 1.0.32)
- LTRData.DiscUtils.Nfs (>= 1.0.32)
- LTRData.DiscUtils.Ntfs (>= 1.0.32)
- LTRData.DiscUtils.OpticalDiscSharing (>= 1.0.32)
- LTRData.DiscUtils.OpticalDisk (>= 1.0.32)
- LTRData.DiscUtils.Registry (>= 1.0.32)
- LTRData.DiscUtils.Sdi (>= 1.0.32)
- LTRData.DiscUtils.SquashFs (>= 1.0.32)
- LTRData.DiscUtils.Swap (>= 1.0.32)
- LTRData.DiscUtils.Udf (>= 1.0.32)
- LTRData.DiscUtils.Vdi (>= 1.0.32)
- LTRData.DiscUtils.Vhd (>= 1.0.32)
- LTRData.DiscUtils.Vhdx (>= 1.0.32)
- LTRData.DiscUtils.VirtualFileSystem (>= 1.0.32)
- LTRData.DiscUtils.Vmdk (>= 1.0.32)
- LTRData.DiscUtils.Wim (>= 1.0.32)
- LTRData.DiscUtils.Xfs (>= 1.0.32)
- LTRData.DiscUtils.Xva (>= 1.0.32)
-
net7.0
- LTRData.DiscUtils.BootConfig (>= 1.0.32)
- LTRData.DiscUtils.Btrfs (>= 1.0.32)
- LTRData.DiscUtils.Core (>= 1.0.32)
- LTRData.DiscUtils.Dmg (>= 1.0.32)
- LTRData.DiscUtils.Ext (>= 1.0.32)
- LTRData.DiscUtils.Fat (>= 1.0.32)
- LTRData.DiscUtils.HfsPlus (>= 1.0.32)
- LTRData.DiscUtils.Iscsi (>= 1.0.32)
- LTRData.DiscUtils.Iso9660 (>= 1.0.32)
- LTRData.DiscUtils.Lvm (>= 1.0.32)
- LTRData.DiscUtils.Net (>= 1.0.32)
- LTRData.DiscUtils.Nfs (>= 1.0.32)
- LTRData.DiscUtils.Ntfs (>= 1.0.32)
- LTRData.DiscUtils.OpticalDiscSharing (>= 1.0.32)
- LTRData.DiscUtils.OpticalDisk (>= 1.0.32)
- LTRData.DiscUtils.Registry (>= 1.0.32)
- LTRData.DiscUtils.Sdi (>= 1.0.32)
- LTRData.DiscUtils.SquashFs (>= 1.0.32)
- LTRData.DiscUtils.Swap (>= 1.0.32)
- LTRData.DiscUtils.Udf (>= 1.0.32)
- LTRData.DiscUtils.Vdi (>= 1.0.32)
- LTRData.DiscUtils.Vhd (>= 1.0.32)
- LTRData.DiscUtils.Vhdx (>= 1.0.32)
- LTRData.DiscUtils.VirtualFileSystem (>= 1.0.32)
- LTRData.DiscUtils.Vmdk (>= 1.0.32)
- LTRData.DiscUtils.Wim (>= 1.0.32)
- LTRData.DiscUtils.Xfs (>= 1.0.32)
- LTRData.DiscUtils.Xva (>= 1.0.32)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.49 | 0 | 12/27/2024 |
1.0.48 | 121 | 11/13/2024 |
1.0.47 | 121 | 9/13/2024 |
1.0.46 | 148 | 6/14/2024 |
1.0.45 | 152 | 4/29/2024 |
1.0.44 | 99 | 4/28/2024 |
1.0.43 | 104 | 4/19/2024 |
1.0.42 | 130 | 4/5/2024 |
1.0.41 | 115 | 4/5/2024 |
1.0.40 | 153 | 3/3/2024 |
1.0.39 | 127 | 2/25/2024 |
1.0.38 | 137 | 2/7/2024 |
1.0.37 | 134 | 1/31/2024 |
1.0.36 | 109 | 1/27/2024 |
1.0.35 | 111 | 1/24/2024 |
1.0.34 | 318 | 12/15/2023 |
1.0.33 | 203 | 11/15/2023 |
1.0.32 | 164 | 11/4/2023 |
1.0.31 | 158 | 10/19/2023 |
1.0.30 | 188 | 10/2/2023 |
1.0.29 | 157 | 9/22/2023 |
1.0.28 | 258 | 6/28/2023 |
1.0.25 | 201 | 5/23/2023 |
1.0.24 | 244 | 4/17/2023 |
1.0.23 | 221 | 4/16/2023 |
1.0.22 | 228 | 4/8/2023 |
1.0.21 | 222 | 3/30/2023 |
1.0.20 | 248 | 3/27/2023 |
1.0.19 | 306 | 3/15/2023 |
1.0.18 | 647 | 1/27/2023 |
1.0.17 | 366 | 1/7/2023 |
1.0.15 | 356 | 1/5/2023 |
1.0.13 | 359 | 12/14/2022 |
1.0.12 | 316 | 12/12/2022 |