13

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

megamania
  • 271
  • 3
  • 9
  • Discutils is a .net library for reading and writing virtual disk images. I'm trying to figure out how to use it and I'm hoping there's someone with more experience with the library who can help me out with some questions. – megamania Jun 03 '14 at 01:12
  • In that case, Please don't just ask us to solve the problem for you. Show us how _you_ tried to solve the problem yourself, then show us _exactly_ what the result was, and tell us why you feel it didn't work. See "[What Have You Tried?](http://whathaveyoutried.com/)" for an excellent article that you _really need to read_. – John Saunders Jun 03 '14 at 01:16

1 Answers1

10

.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.

viteo
  • 303
  • 3
  • 13