# File lib/PascalDisk.rb, line 52
        def read_catalog
        catalog=get_block(2)
        #we've read the first block in the catalog, now read the rest
        catalog_size=catalog[2]
        3.upto(catalog_size-1) do |i|
          catalog<<get_block(i)
        end
#       06    VOLUME NAME LENGTH (1 byte)
#       07..0D        VOLUME NAME (17 bytes)
#       0E..0F        VOLUME SIZE (WORD)
#       10    NUMBER OF FILES (BYTE)
        volume_name_length=catalog[6]
        self.volume_name=catalog[7..6+volume_name_length]
        files_in_volume=catalog[0x10]
        #read in all the files
        
#       00..01        FIRST BLOCK (word)    
#       02..03        LAST BLOCK+1 (word)
#       04    FILE TYPE (byte) =  untypedfile,xdskfile,codefile,textfile,infofile,datafile,graffile,fotofile,securdir
#       05    STATUS (byte)
#       06    FILENAME LENGTH (1 byte)
#       07..15        FILENAME (15 bytes)
#       16..17        BYTES IN LAST BLOCK (word)
#       18.1A FILE ACCESS DATE
        1.upto(files_in_volume) do |file_no|
          file_record=catalog[file_no*0x1a..(file_no*0x1a+0x19)]
          first_block=file_record[0]+file_record[1]*0x100
          first_block_in_next_file=file_record[2]+file_record[3]*0x100
          last_block=first_block_in_next_file-1
          file_type=file_record[4]
          file_name_length=file_record[6]
          file_name=file_record[7..6+file_name_length]
          bytes_in_last_block=file_record[0x16]+file_record[0x17]*0x100
          file_contents=""
          first_block.upto(last_block) do |block_no|
            this_block=get_block(block_no)
            if block_no==last_block then
              file_contents<<this_block[0..bytes_in_last_block-1]
            else
              file_contents<<this_block 
            end
          files[file_name]=PascalFile.new(file_name,file_contents,file_type)
        end        
      end
        end