纯 MoonBit 的 ISO 9660 光盘映像读写库:卷描述符、目录树、Joliet、Rock Ridge 与镜像生成
moon add LL728/moonisomoon run cmd/main -- info tools/corpus/minimal.iso
moon run cmd/main -- ls tools/corpus/minimal.iso
moon run cmd/main -- ls tools/corpus/minimal.iso /SUBvolume_id=MOONISO_TEST
block_size=2048
volume_space_size=24
root_extent=20
root_size=2048HELLO.TXT file 17 2026-01-02T03:04:05
SUB dir 2048 2026-01-02T03:04:05let image = @mooniso.IsoImage::open(@fs.read_file_to_bytes("image.iso"))
println(image.volume_id())
for entry in image.list_dir("/SUB") {
println("\{entry.name}\t\{entry.size}")
}moon test --target wasm-gc # 单元测试:字节序、目录记录、名称规范化
python tools/gen_fixtures.py # 生成 tools/corpus/minimal.iso
python tools/check_e2e.py # 用 CLI 读映像,与期望输出逐行比对pub suberror IsoError {
Truncated
BadBothEndian
BadSignature
BadDescriptor(Int)
NotFound(String)
NotDirectory(String)
BadDirectoryRecord(Int)
}pub struct ByteReader {
data : Bytes
pos : Int
}pub struct IsoImage {
data : Bytes
volume_id : String
block_size : Int
volume_space_size : Int
root : DirectoryRecord
}pub struct PrimaryVolumeDescriptor {
volume_id : String
volume_space_size : Int
logical_block_size : Int
path_table_size : Int
root : DirectoryRecord
}pub struct RecordDate {
year : Int
month : Int
day : Int
hour : Int
minute : Int
second : Int
gmt_offset_quarters : Int
}fn normalize_iso_name(raw : String) -> Stringfn parse_primary_volume_descriptor(data : Bytes, lba : Int) -> PrimaryVolumeDescriptor raise IsoErrorInstall
Download zip纯 MoonBit 的 ISO 9660 光盘映像读写库:卷描述符、目录树、Joliet、Rock Ridge 与镜像生成