Module: Omnizip::Formats::Iso
- Defined in:
- lib/omnizip/formats/iso.rb,
lib/omnizip/formats/iso/joliet.rb,
lib/omnizip/formats/iso/reader.rb,
lib/omnizip/formats/iso/writer.rb,
lib/omnizip/formats/iso/path_table.rb,
lib/omnizip/formats/iso/rock_ridge.rb,
lib/omnizip/formats/iso/volume_builder.rb,
lib/omnizip/formats/iso/directory_record.rb,
lib/omnizip/formats/iso/directory_builder.rb,
lib/omnizip/formats/iso/volume_descriptor.rb
Overview
ISO 9660 CD-ROM filesystem format support Provides read-only access to ISO images
ISO 9660 is the standard filesystem for CD-ROMs and DVD-ROMs. This implementation supports:
- Primary Volume Descriptor parsing
- Directory structure traversal
- File extraction
- Rock Ridge extensions (basic)
Defined Under Namespace
Modules: Joliet, RockRidge Classes: DirectoryBuilder, DirectoryRecord, PathTable, Reader, VolumeBuilder, VolumeDescriptor, Writer
Constant Summary collapse
- SECTOR_SIZE =
ISO 9660 constants
2048- SYSTEM_AREA_SECTORS =
16- VOLUME_DESCRIPTOR_START =
SYSTEM_AREA_SECTORS- VD_BOOT_RECORD =
Volume descriptor types
0- VD_PRIMARY =
1- VD_SUPPLEMENTARY =
2- VD_PARTITION =
3- VD_TERMINATOR =
255- FLAG_HIDDEN =
File flags
0x01- FLAG_DIRECTORY =
0x02- FLAG_ASSOCIATED =
0x04- FLAG_EXTENDED =
0x08- FLAG_PERMISSIONS =
0x10- FLAG_NOT_FINAL =
0x80
Class Method Summary collapse
-
.create(path, options = {}) {|writer| ... } ⇒ String
Create ISO 9660 image.
-
.extract(iso_path, output_dir) ⇒ Object
Extract ISO contents.
-
.info(path) ⇒ Hash
Get ISO volume information.
-
.list(path) ⇒ Array<DirectoryRecord>
List contents of ISO image.
-
.open(path) {|reader| ... } ⇒ Reader
Open existing ISO image.
-
.register! ⇒ Object
Auto-register ISO format when loaded.
Class Method Details
.create(path, options = {}) {|writer| ... } ⇒ String
Create ISO 9660 image
123 124 125 126 127 128 129 |
# File 'lib/omnizip/formats/iso.rb', line 123 def self.create(path, = {}) writer = Writer.new(path, ) yield writer if block_given? writer.write end |
.extract(iso_path, output_dir) ⇒ Object
Extract ISO contents
79 80 81 82 83 |
# File 'lib/omnizip/formats/iso.rb', line 79 def self.extract(iso_path, output_dir) open(iso_path) do |iso| iso.extract_all(output_dir) end end |
.info(path) ⇒ Hash
Get ISO volume information
89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/omnizip/formats/iso.rb', line 89 def self.info(path) open(path) do |iso| { format: "ISO 9660", volume_id: iso.volume_identifier, system_id: iso.system_identifier, size: iso.volume_size, files: iso.entries.count { |e| !e.directory? }, directories: iso.entries.count(&:directory?), } end end |
.list(path) ⇒ Array<DirectoryRecord>
List contents of ISO image
71 72 73 |
# File 'lib/omnizip/formats/iso.rb', line 71 def self.list(path) open(path, &:entries) end |
.open(path) {|reader| ... } ⇒ Reader
Open existing ISO image
52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/omnizip/formats/iso.rb', line 52 def self.open(path) reader = Reader.new(path) reader.open if block_given? begin yield reader ensure reader.close end end reader end |
.register! ⇒ Object
Auto-register ISO format when loaded
132 133 134 |
# File 'lib/omnizip/formats/iso.rb', line 132 def self.register! FormatRegistry.register(".iso", Reader) end |