def make_catalog(relative_path)
s="<p>"
begin
absolute_path=make_absolute_path(relative_path)
dsk=get_dsk_from_cache(absolute_path)
s<<"<br>file system: #{dsk.file_system}<br>sector order: #{dsk.sector_order}<br>tracks: #{dsk.track_count}<br>"
if (dsk.respond_to?(:files)) then
s<<"<table>\n<th>TYPE</th><th>SIZE (BYTES)</th><th>NAME</th></tr>\n"
dsk.files.keys.sort.each do |full_path|
f=dsk.files[full_path]
display_url="/showfile/#{uri_encode(relative_path)+'?filename='+uri_encode(full_path)}"
if f.respond_to?(:file_type) then
s<<"<td>#{f.file_type}</td>"
else
s<<"<td></td>"
end
s<<"<td>#{sprintf('%03d',f.contents.length)}</td>"
s<<"<td>#{full_path}</td>"
s<<"<td><a href=#{display_url}&mode=hex>hex dump</a></td>"
if f.can_be_picture? then
s<<"<td><a href=#{display_url}&mode=png>picture</a></td>"
elsif f.respond_to?(:disassembly)
s<<"<td><a href=#{display_url}&mode=list>disassembly</a></td>"
else
s<<"<td><a href=#{display_url}&mode=text>text</a></td>"
end
s<<"</tr>\n"
end
s<<"</table>"
else
s<<"<i>not a recognised format</i>"
end
s<<"<p><a href=/showsector/#{uri_encode(relative_path)}>View Sectors</a>"
rescue Exception => exception
s<<"<i>ERROR:#{exception}</i>"
end
s
end