$:.unshift(File.dirname(__FILE__)) unless $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__))) $:.unshift(File.dirname(__FILE__+"\\..")) unless $:.include?(File.dirname(__FILE__+"\\..")) || $:.include?(File.expand_path(File.dirname(__FILE__+"\\.."))) require 'FileSystem' # Disk image in NADOL format # #CATALOG will be at track $00, sector $03 to track $00, sector $09 #each entry consists of $10 bytes, which are: # 00-0B - filename - if file is deleted, first byte will be FF # 0C-0D - filesize (low byte first) # 0E - track of track sector list sector # 0F - sector of track sector list sector # #TRACK/SECTOR LIST FORMAT # pairs of track/sectors in order. up to 128 entries [assumes that no file can be > 128 sectors] # #SECTOR USAGE BITMAP #is at Track $00, Sector $2, from bytes $20 .. $65 #bitmap is of form: # # ----hi bit-- # | | # 01234567 89ABCDEF # ^^^^^^ ^^^^^^^ # low byte hi byte class NADOLDos0) then contents="" ts_list_track_no=file_descriptive_entry[0x0E] ts_list_sector_no=file_descriptive_entry[0x0F] ts_list_sector=file_system_image.get_sector(ts_list_track_no,ts_list_sector_no) for entry_number in 0..0x7f data_track_no=ts_list_sector[entry_number*2] data_sector_no=ts_list_sector[entry_number*2+1] if( (data_track_no!=0 || data_sector_no!=0) && data_sector_no<=0x0f) then contents<