Joliet adds Unicode names to ISO 9660. Use sample.iso from the zip.
dotnet add package RecursiveAI.OneArchiveRequires .NET 10 (net10.0); .NET 9 and earlier aren’t supported.
using RecursiveAI.OneArchive.Iso; using var image = File.OpenRead("sample.iso"); using var iso = new IsoReader(image, new() { Tree = IsoTree.Joliet }); foreach (var entry in iso.Items) Console.WriteLine(entry.Name);
Unzip the example, then dotnet run.
Prints the names without extracting either file:
café.txt 資料.txt
IsoTree.Joliet throws ArchiveUnsupportedException when the image has no Joliet volume descriptor.
Variations
Let the reader choose the directory tree. Use new IsoReader(image) in place of the constructor call above. The default prefers Rock Ridge when active, then Joliet if present, then the primary ISO 9660 tree.
using var iso = new IsoReader(image);On the sample, the default also prints café.txt and 資料.txt.
See the plain ISO 9660 identifiers instead. Select the primary tree and disable Rock Ridge so it doesn’t substitute its own names:
using var iso = new IsoReader(image, new IsoReaderOptions { Tree = IsoTree.Primary, UseRockRidge = false });
On the sample, the primary tree prints CAF_.TXT and __.TXT.
Related recipes
The short answer
Open the ISO file as a stream, pass IsoTree.Joliet to IsoReader, and read Name from each item in Items. This lists the names from the Joliet hierarchy, even if the same image also has Rock Ridge names. Opening and printing the listing doesn’t open the individual files or write them to disk.
How do I view the contents of an ISO file without mounting it?
For an ISO 9660 image, read the directory listing directly. OneArchive’s ISO reader reads the volume descriptors and follows the directories of the selected tree. That gives you a list of names and metadata without treating the image as a mounted drive. Items lists directories as well as files when the image contains both. Reading file data is a separate step: IsoReader.OpenEntryStream opens an entry when you need its contents rather than its name.
The distinction matters when you only want to inventory a disc image. You can report the names and sizes without creating an extraction directory or making a copy of every file. The sample has both names, café.txt and 資料.txt, at the root, so the listing is just two lines.
What is Joliet in an ISO 9660 image?
Joliet stores a supplementary directory hierarchy with Unicode names. The same image can have a plain primary hierarchy for readers that don’t use Joliet. Rock Ridge works differently: it adds names and other metadata to the primary hierarchy. As a result, the name shown for a file can depend on which tree and extensions the reader uses. IsoTree.Joliet makes the choice explicit instead of relying on the default preference.
If a Joliet name is already shortened or changed in the image, a different text encoding in your C# program won’t bring the missing characters back. For example, OneArchive’s ISO writer limits Joliet names to 64 UTF-16 units and replaces forbidden characters with _ when it creates an image. The reader reports the name stored in the chosen hierarchy.
What if an ISO file doesn’t have Joliet?
Keep the explicit Joliet setting if a Joliet listing is a requirement: a missing Joliet descriptor is a distinct error, not an empty listing. If any usable directory listing will do, use the default reader from the first variation. It can list an ISO 9660 image with no Joliet descriptor by using the primary tree. Name then comes from the chosen naming source, so don’t label all automatically selected names as Joliet in a report.