---
title: "Read Joliet file names from an ISO in C#"
url: https://recursiveai.org/onearchive/cookbook/list-iso9660-file-names-with-joliet/
description: "Read Unicode file names from a Joliet ISO 9660 image in C# with OneArchive. List the Joliet directory tree without mounting the ISO or extracting files."
version: "1.2.0"
---

# Read Joliet file names from an ISO in C#

**OneArchive** is a free, open-source archive and compression library for .NET from Recursive AI: zip, tar, 7z, RAR and more in RecursiveAI.OneArchive, with compression codecs in RecursiveAI.OneCompress. MIT or Apache-2.0, no native dependencies.

[NuGet](https://www.nuget.org/packages/RecursiveAI.OneArchive) · [GitHub](https://github.com/recursive-ai-oss/onearchive-csharp) · [Docs](https://recursiveai.org/onearchive/docs/) · [Download example (.zip)](https://recursiveai.org/onearchive/cookbook/list-iso9660-file-names-with-joliet/list-iso9660-file-names-with-joliet.zip)

Joliet adds Unicode names to ISO 9660. Use `sample.iso` from the zip.

```shell
dotnet add package RecursiveAI.OneArchive
```

Requires [.NET 10](https://dotnet.microsoft.com/download/dotnet/10.0) (net10.0); .NET 9 and earlier aren’t supported.

```csharp
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](https://recursiveai.org/onearchive/cookbook/list-iso9660-file-names-with-joliet/list-iso9660-file-names-with-joliet.zip), then `dotnet run`.

Prints the names without extracting either file:

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

```csharp
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:

```csharp
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

- [Extract files from an ISO](https://recursiveai.org/onearchive/cookbook/extract-iso-files/)
- [Create an ISO 9660 image](https://recursiveai.org/onearchive/cookbook/create-iso9660-image/)

## 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](https://recursiveai.org/onearchive/docs/iso/) 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](https://pismotec.com/cfs/jolspec.html) 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](https://recursiveai.org/onearchive/docs/iso/#writing) 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.
