# File lib/file_systems/AppleCPM.rb, line 72
def self.files(file_system_image)
  files=FileContainer.new
  catalog=get_block(file_system_image,0)+get_block(file_system_image,1)
  0.upto(63) do |dir_entry_no|
    dir_entry_start=dir_entry_no*0x20
    dir_entry=catalog[dir_entry_start..dir_entry_start+0x1F]      
    if (dir_entry[0]<0x10) then
      file_name=dir_entry[0x01..0x08].gsub(' ','')
      file_ext=dir_entry[0x09..0x0B].gsub(' ','')
      full_filename="#{file_name}.#{file_ext}"
      files<<NativeFileType.best_fit(file_system_image,full_filename,'',file_ext)
      if files[full_filename].nil? then
        files<<file 
      end
      s=""
      0x10.upto(0x1f) do |i|
        block=dir_entry[i]
        s+=get_block(file_system_image,block) unless block==0
      end        
      records_allocated=dir_entry[0x0F]
      files[full_filename].contents+=s[0,(records_allocated*128)]
    end
  end    
  files
end