I'm trying to modify an existing iso file by adding files using discutils. So far I've tried CDBuilder but that only allows creating an iso file. CDReader can open the file and I can enumerate the contents but I can't find a way of adding files.
Can anyone point me in the right direction?
Edit: There's a CDReader class that can be used to open an existing .iso file. Once open, you can enumerate the contents should you wish to extract files, but there is no clear method for adding a file. e.g.
using (FileStream fs = File.Open(imageFilePath, FileMode.Open))
{
CDReader cd = new CDReader(fs, true, true);
foreach (var dir in cd.Root.GetDirectories())
{
Console.WriteLine(dir.Name);
}
}
There is also a CDBuilder class which is used to build .iso files from scratch, but it cannot be used to open an existing .iso file. Yes I could create a temporary copy of the .iso image as CDBuilder object but I that would consume a lot of memory especially when adding a large number of files. Can the discutils library be used for this purpose?
Thanks
.NET DiscUtils only supports reading or creating ISO files. Modifying is not supported yet. And yes, the only way for you is to recreate ISO from existing with DiskUtils.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With