I'm developing a function to verify if the ISO has Joliet extension. I use DiscUtils to create the ISO file as follow
CDBuilder builder = new CDBuilder();
builder.UseJoliet = true;
builder.VolumeIdentifier = "A_SAMPLE_DISK";
builder.AddFile("x/x.png", @"C:\Users\Circle\Pictures\Image 1.png");
builder.Build(@"C:\temp\sample.iso");
However, when I read the ISO file. It doesn't be recognized as Joliet
using (FileStream isoStream = File.Open(@"C:\temp\sample.iso", FileMode.Open))
{
CDReader cd = new CDReader(isoStream, true);
if (cd.ActiveVariant == Iso9660Variant.Joliet)
{
// Never enter here
}
}
Not sure which part I did wrong. Any suggestions?
You don't appear to be doing it wrong; however the code won't ever set that ActiveVariant.
If you look at the underlying code, it seems to switch the
ActiveVarianttoIso9660Variant.Iso9660for joliet extensions for the purposes of that field. I don't know the reason for that - it might be a bug, it might have some other esoteric reason for doing it based on some other code in the project.I've added a couple of comments to the code, and reproduced it here.